Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 public function getUsers()
 {
     $filter = array("authentication", "=", $this->id);
     return UserIterator::loadBy($this->configuration(), $filter, $this->database(), false);
 }
Ejemplo n.º 3
0
 public static function loadByRole(Configuration $configuration, $id, EnhancedDatabase $database = null, $controller = false)
 {
     $iterator = new Iterator($configuration, $database, $controller);
     return $iterator->loadDataByRole($id);
 }
Ejemplo n.º 4
0
 public function getUsers()
 {
     return UserIterator::loadByRole($this->configuration(), $this->id, $this->database(), false);
 }