diff options
| author | 2015-01-06 20:50:58 +0100 | |
|---|---|---|
| committer | 2015-01-06 20:50:58 +0100 | |
| commit | 5f9672111f86c693d843138c00934a6c3eeede45 (patch) | |
| tree | 4aa58d52cb0650c482820db6d3be6606bfa5c163 /app/Models/Auth.php | |
| parent | d3a93ea2905ae50a2365d293f9f3ef3e51bf5f30 (diff) | |
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
Diffstat (limited to 'app/Models/Auth.php')
| -rw-r--r-- | app/Models/Auth.php | 14 |
1 files changed, 12 insertions, 2 deletions
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)); |
