Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. public function signInFormSucceeded($form, $values)
  2.     {
  3.         $user = $this->getUser();  
  4.            
  5.             if ($values->remember) {
  6.             $user->setExpiration('14 days', FALSE);
  7.         } else {
  8.             $user->setExpiration('20 minutes', TRUE);
  9.         }
  10.  
  11.         try {
  12.             $user->login($values->username, $values->password);
  13.            
  14.                         if($user->getRoles() == "admin") //tady je asi chyba
  15.                         {
  16.                             $this->redirect('Admin:');
  17.                         }
  18.  
  19.                         //$this->redirect('Homepage:');
  20.  
  21.         } catch (Nette\Security\AuthenticationException $e) {
  22.             $form->addError($e->getMessage());
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement