Ejemplo n.º 1
0
 public function login()
 {
     if (FORM_AdminLoginForm::getInstance()->isValid4Process()) {
         $data = FORM_AdminLoginForm::getInstance()->getData();
         $login = $data->getLogin();
         $passwd = $data->getPassword();
         AuthManager::loginAdmin($login, $passwd);
     }
     return AuthManager::isAuthorized();
 }
Ejemplo n.º 2
0
 protected function doProcess(PageContext $ctxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams)
 {
     $this->authed = AuthManager::isAuthorizedAsAdmin();
     if ($this->authed) {
         $this->adminPage = AdminPagesManager::getInstance()->getCurrentPage();
     } else {
         if (FORM_AdminLoginForm::getInstance()->isValid4Process()) {
             if (AdminAuthManager::getInstance()->login()) {
                 WebPages::reloadCurPage();
             }
         }
     }
 }
Ejemplo n.º 3
0
 protected function doProcess(PageContext $ctxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams)
 {
     $this->authed = AuthManager::isAuthorizedAsAdmin();
     if ($this->authed) {
         $this->adminPage = AdminPagesManager::getInstance()->getCurrentPage();
     } else {
         //Показываем форму авторизации админа только если используем базовый провайдер безопасности
         if (PsSecurity::isBasic() && FORM_AdminLoginForm::getInstance()->isValid4Process()) {
             if (AdminAuthManager::getInstance()->login()) {
                 PsUtil::redirectToSelf();
             }
         }
     }
 }