This repository has been archived on 2020-05-04. You can view files and clone it, but cannot push or open issues or pull requests.
phunk/application/classes/Controller/Games.php
2013-04-17 09:00:16 +07:00

18 lines
606 B
PHP

<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Games extends Controller_Template {
public $template = 'games/add';
public function action_add() {
//$this->template = 'games/add';
if ($_POST){
$user = ORM::factory('user');
if (Auth::instance()->login('author')){
$game = ORM::factory('game');
$game->values($this->request->post());
$game->create();
}
else $this->template->error = "Недостаточно прав для добавления игры. Обратитесь за помощью к администратору сервиса.";
}
}
}