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; }
public function getUsers() { $filter = array("authentication", "=", $this->id); return UserIterator::loadBy($this->configuration(), $filter, $this->database(), false); }