예제 #1
0
파일: Game.php 프로젝트: modulargaming/game
 public function before()
 {
     parent::before();
     if ($this->game_id) {
         $game = ORM::factory('User_Game')->where('game_id', '=', $this->game_id)->where('user_id', '=', $this->user->id)->find();
         if (!$game->loaded()) {
             $game = ORM::factory('User_Game')->create_game(array('game_id' => $this->game_id, 'user_id' => $this->user->id), array('game_id', 'user_id'));
         }
         $this->game = $game;
     }
 }
예제 #2
0
 public function before()
 {
     $this->config = Kohana::$config->load('forum');
     // Set forum to protected if we do not allow guests.
     // TODO: improve this check, database based depending on category?
     // Perhapse we should use policies?
     if ($this->protected === FALSE and $this->config['guest'] === FALSE) {
         $this->protected = TRUE;
     }
     parent::before();
     // TODO: Check if user can view forum?
 }
예제 #3
0
 public function before()
 {
     parent::before();
     $permission = $this->request->controller() . '_' . $this->request->action();
 }