/** @return AdminAuthManager */ public static function getInstance() { if (self::$instance == NULL) { self::$instance = new AdminAuthManager(); } return self::$instance; }
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(); } } } }
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(); } } } }