getStorage() публичный Метод

public getStorage ( ) : Nette\Security\IUserStorage
Результат Nette\Security\IUserStorage
 public function adminLogin($username, $password)
 {
     $row = $this->database->table('loginadmin')->where('name', $username)->fetch();
     if (!$row) {
         throw new Nette\Security\AuthenticationException('Nesprávné přihlašovací jméno.');
     }
     if (!($password == $row['password'])) {
         throw new Nette\Security\AuthenticationException('Nesprávné heslo.');
     }
     $this->user->getStorage()->setNamespace('App\\AdminModule');
     $this->user->login(new Nette\Security\Identity($row['id'], $row['name']));
 }
Пример #2
0
 public function onLoggedOut(Security $security)
 {
     // BUG: Nette\Security\User 2.1 fires onLoggedOut before clearing storage
     if ($user = $this->repository->find($security->getIdentity()->getId())) {
         $security->getStorage()->setAuthenticated(FALSE);
         $this->user->signOut($user);
     }
 }
Пример #3
0
 /**
  * @param \Nette\Security\User $user
  */
 public function setup(User $user)
 {
     $user->getStorage()->setNamespace($this->namespace);
     $user->setAuthenticator($this->authenticator);
     $user->setAuthorizator($this->authorizator);
 }
Пример #4
0
 /**
  * @param bool $isAuthenticated
  */
 public function setAuthenticated($isAuthenticated)
 {
     $this->user->getStorage()->setAuthenticated($isAuthenticated);
 }