/** * Validates user credentials * * @return TRUE - if validation passed, and FALSE - otherwise */ public function validate() { if (AdminManager::getInstance()->validate($this->getId(), $this->getUniqueId())) { return true; } throw new InvalidUserException("wrong user"); }
public function service() { $adminDto = AdminManager::getInstance()->getByUsernamePassword(NGS()->args()->getUsername(), md5(NGS()->args()->getPassword())); if (!$adminDto) { $this->redirect('login'); } NGS()->getSessionManager()->login(UserGroups::$ADMIN, $adminDto->getId()); $this->redirect(''); }