From 5f9672111f86c693d843138c00934a6c3eeede45 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 6 Jan 2015 20:50:58 +0100 Subject: Fix last calls to Minz_Configuration methods - We have still to fix actualize_script and greader api (refactoring?) - We have to fix the FreshRSS_Configuration calls - We have to fix availableLanguages calls See https://github.com/FreshRSS/FreshRSS/issues/730 --- app/Models/Auth.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'app/Models/Auth.php') diff --git a/app/Models/Auth.php b/app/Models/Auth.php index 05ec61d0e..917e151ca 100644 --- a/app/Models/Auth.php +++ b/app/Models/Auth.php @@ -158,7 +158,16 @@ class FreshRSS_Auth { /** * Return if authentication is enabled on this instance of FRSS. */ - public static function accessNeedLogin() { + public static function accessNeedsLogin() { + $conf = Minz_Configuration::get('system'); + $auth_type = $conf->auth_type; + return $auth_type !== 'none'; + } + + /** + * Return if authentication requires a PHP action. + */ + public static function accessNeedsAction() { $conf = Minz_Configuration::get('system'); $auth_type = $conf->auth_type; return $auth_type === 'form' || $auth_type === 'persona'; @@ -206,7 +215,8 @@ class FreshRSS_FormAuth { public static function makeCookie($username, $password_hash) { do { - $token = sha1(Minz_Configuration::salt() . $username . uniqid(mt_rand(), true)); + $conf = Minz_Configuration::get('system'); + $token = sha1($conf->salt . $username . uniqid(mt_rand(), true)); $token_file = DATA_PATH . '/tokens/' . $token . '.txt'; } while (file_exists($token_file)); -- cgit v1.2.3