예제 #1
0
 public function release(UserView $user)
 {
     $filter = array("username", "=", $username);
     $users = UserIterator::loadBy($this->configuration, $filter, $this->database);
     if (count($users) != 1) {
         throw new AuthenticationException("Unknown user or wrong password");
     }
     $user = $users[0];
     if ($user->enabled === false) {
         throw new AuthenticationException("Account locked, please contact administrator.");
     }
     if ($user->getAuthentication()->getProvider()->release($user) !== true) {
         throw new AuthenticationException("Unknown user or wrong password");
     }
     return true;
 }
예제 #2
0
 public function getUsers()
 {
     $filter = array("authentication", "=", $this->id);
     return UserIterator::loadBy($this->configuration(), $filter, $this->database(), false);
 }
예제 #3
0
 public static function loadByRole(Configuration $configuration, $id, EnhancedDatabase $database = null, $controller = false)
 {
     $iterator = new Iterator($configuration, $database, $controller);
     return $iterator->loadDataByRole($id);
 }
예제 #4
0
 public function getUsers()
 {
     return UserIterator::loadByRole($this->configuration(), $this->id, $this->database(), false);
 }