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
파일: Listener.php 프로젝트: rixxi/user
 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);
 }