aboutsummaryrefslogtreecommitdiff
path: root/app/Models/FormAuth.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/FormAuth.php')
-rw-r--r--app/Models/FormAuth.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/Models/FormAuth.php b/app/Models/FormAuth.php
index 83fb60e3c..a8b4dab8a 100644
--- a/app/Models/FormAuth.php
+++ b/app/Models/FormAuth.php
@@ -23,7 +23,7 @@ class FreshRSS_FormAuth {
$token_file = DATA_PATH . '/tokens/' . $token . '.txt';
$mtime = @filemtime($token_file) ?: 0;
- $limits = FreshRSS_Context::$system_conf->limits;
+ $limits = FreshRSS_Context::systemConf()->limits;
$cookie_duration = empty($limits['cookie_duration']) ? FreshRSS_Auth::DEFAULT_COOKIE_DURATION : $limits['cookie_duration'];
if ($mtime + $cookie_duration < time()) {
// Token has expired (> cookie_duration) or does not exist.
@@ -42,7 +42,7 @@ class FreshRSS_FormAuth {
private static function renewCookie(string $token) {
$token_file = DATA_PATH . '/tokens/' . $token . '.txt';
if (touch($token_file)) {
- $limits = FreshRSS_Context::$system_conf->limits;
+ $limits = FreshRSS_Context::systemConf()->limits;
$cookie_duration = empty($limits['cookie_duration']) ? FreshRSS_Auth::DEFAULT_COOKIE_DURATION : $limits['cookie_duration'];
$expire = time() + $cookie_duration;
Minz_Session::setLongTermCookie('FreshRSS_login', $token, $expire);
@@ -54,7 +54,7 @@ class FreshRSS_FormAuth {
/** @return string|false */
public static function makeCookie(string $username, string $password_hash) {
do {
- $token = sha1(FreshRSS_Context::$system_conf->salt . $username . uniqid('' . mt_rand(), true));
+ $token = sha1(FreshRSS_Context::systemConf()->salt . $username . uniqid('' . mt_rand(), true));
$token_file = DATA_PATH . '/tokens/' . $token . '.txt';
} while (file_exists($token_file));
@@ -78,7 +78,7 @@ class FreshRSS_FormAuth {
}
public static function purgeTokens(): void {
- $limits = FreshRSS_Context::$system_conf->limits;
+ $limits = FreshRSS_Context::systemConf()->limits;
$cookie_duration = empty($limits['cookie_duration']) ? FreshRSS_Auth::DEFAULT_COOKIE_DURATION : $limits['cookie_duration'];
$oldest = time() - $cookie_duration;
foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $file_info) {