Esempio n. 1
0
 public function __construct()
 {
     if (Auth::IsAuth()) {
         header('location: /game');
         die;
     }
 }
Esempio n. 2
0
 public function init()
 {
     //если не авторизован перенаврабляем на страницу авторизации
     if (!Auth::IsAuth()) {
         header('location: /visitor/login');
         die;
     }
     $this->view = new View();
     $this->view->notification = Notification::Get();
     $stats = Stats::FindByColumn('login', Auth::GetLogin());
     if ($stats === false) {
         Auth::Logout();
         header('location: /visitor/login');
         die;
     }
     $this->view->stats = $stats;
     $state = State::FindByColumn('login', Auth::GetLogin());
     if ($state->state == 'gamer') {
         header('location: /game');
         die;
     }
 }