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(); }
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(); } } } }