diff options
Diffstat (limited to 'app/Controllers/authController.php')
| -rw-r--r-- | app/Controllers/authController.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 342c577e2..403c92790 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -112,8 +112,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { Minz_View::prependTitle(_t('gen.auth.login') . ' ยท '); Minz_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js'))); - $conf = Minz_Configuration::get('system'); - $limits = $conf->limits; + $limits = FreshRSS_Context::$system_conf->limits; $this->view->cookie_days = round($limits['cookie_duration'] / 86400, 1); $isPOST = Minz_Request::isPost() && !Minz_Session::param('POST_to_GET'); @@ -124,38 +123,38 @@ class FreshRSS_auth_Controller extends Minz_ActionController { $username = Minz_Request::param('username', ''); $challenge = Minz_Request::param('challenge', ''); - $conf = get_user_configuration($username); - if ($conf == null) { + FreshRSS_Context::initUser($username); + if (FreshRSS_Context::$user_conf == null) { //We do not test here whether the user exists, so most likely an internal error. Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); return; } - if (!$conf->enabled) { + if (!FreshRSS_Context::$user_conf->enabled) { Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); return; } $ok = FreshRSS_FormAuth::checkCredentials( - $username, $conf->passwordHash, $nonce, $challenge + $username, FreshRSS_Context::$user_conf->passwordHash, $nonce, $challenge ); if ($ok) { // Set session parameter to give access to the user. Minz_Session::_params([ 'currentUser' => $username, - 'passwordHash' => $conf->passwordHash, + 'passwordHash' => FreshRSS_Context::$user_conf->passwordHash, 'csrf' => false, ]); FreshRSS_Auth::giveAccess(); // Set cookie parameter if nedded. if (Minz_Request::param('keep_logged_in')) { - FreshRSS_FormAuth::makeCookie($username, $conf->passwordHash); + FreshRSS_FormAuth::makeCookie($username, FreshRSS_Context::$user_conf->passwordHash); } else { FreshRSS_FormAuth::deleteCookie(); } - Minz_Translate::init($conf->language); + Minz_Translate::init(FreshRSS_Context::$user_conf->language); // All is good, go back to the index. Minz_Request::good(_t('feedback.auth.login.success'), @@ -183,12 +182,12 @@ class FreshRSS_auth_Controller extends Minz_ActionController { FreshRSS_FormAuth::deleteCookie(); - $conf = get_user_configuration($username); - if ($conf == null) { + FreshRSS_Context::initUser($username); + if (FreshRSS_Context::$user_conf == null) { return; } - $s = $conf->passwordHash; + $s = FreshRSS_Context::$user_conf->passwordHash; $ok = password_verify($password, $s); unset($password); if ($ok) { @@ -199,7 +198,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { ]); FreshRSS_Auth::giveAccess(); - Minz_Translate::init($conf->language); + Minz_Translate::init(FreshRSS_Context::$user_conf->language); Minz_Request::good(_t('feedback.auth.login.success'), array('c' => 'index', 'a' => 'index')); |
