protected function startup() { parent::startup(); if ($this->user->isLoggedIn()) { $this->redirect('Homepage:'); } }
protected function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { $this->redirect('Login:default'); } }
public function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { if ($this->user->logoutReason === Nette\Security\IUserStorage::INACTIVITY) { $this->flashMessage('Byli jste odhlášeni z důvodu nečinnosti. Přihlaste se prosím znovu.', 'danger'); } $this->redirect(':Sign:in', ['backlink' => $this->storeRequest()]); } elseif (!$this->user->isAllowed($this->name, Model\Authorizator::READ)) { $this->flashMessage('Přístup byl odepřen. Nemáte oprávnění k zobrazení této stránky.', 'danger'); $this->redirect(':Sign:in', ['backlink' => $this->storeRequest()]); } }