public function __construct() { if (Auth::IsAuth()) { header('location: /game'); die; } }
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; } }