Example #1
0
 protected function startup()
 {
     parent::startup();
     if ($this->user->isLoggedIn()) {
         $this->redirect('Homepage:');
     }
 }
Example #2
0
 protected function startup()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->redirect('Login:default');
     }
 }
Example #3
0
 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()]);
     }
 }