18 lines
606 B
PHP
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 = "Недостаточно прав для добавления игры. Обратитесь за помощью к администратору сервиса.";
|
|
}
|
|
}
|
|
}
|