summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdan <[email protected]>2021-05-12 04:43:04 +0300
committerkdan <[email protected]>2021-05-12 04:43:04 +0300
commit6c06a26649459b33070281132f9977480c87d3c1 (patch)
tree5463b2f06da93d2e919b2c1fb89bc8b81993273a
parent2ccf0e50a25086bb81155492ee9ebd1ac755c035 (diff)
parentf423874e0585699dfc239c8e4187b53a9a3c02da (diff)
Merge branch 'master' into master
-rw-r--r--classes/config.php3
-rw-r--r--classes/userhelper.php2
-rw-r--r--include/sessions.php12
3 files changed, 8 insertions, 9 deletions
diff --git a/classes/config.php b/classes/config.php
index 6e8d4533f..4ae4a2407 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -484,7 +484,8 @@ class Config {
array_push($errors, "Data export cache is not writable (chmod -R 777 ".self::get(Config::CACHE_DIR)."/export)");
}
- if (self::get(Config::SINGLE_USER_MODE) && class_exists("PDO")) {
+ // ttrss_users won't be there on initial startup (before migrations are done)
+ if (!Config::is_migration_needed() && self::get(Config::SINGLE_USER_MODE)) {
if (UserHelper::get_login_by_id(1) != "admin") {
array_push($errors, "SINGLE_USER_MODE is enabled but default admin account (ID: 1) is not found.");
}
diff --git a/classes/userhelper.php b/classes/userhelper.php
index 0bf67243e..1cdd320a1 100644
--- a/classes/userhelper.php
+++ b/classes/userhelper.php
@@ -75,7 +75,7 @@ class UserHelper {
$_SESSION["auth_module"] = false;
- if (!$_SESSION["csrf_token"])
+ if (empty($_SESSION["csrf_token"]))
$_SESSION["csrf_token"] = bin2hex(get_random_bytes(16));
$_SESSION["ip_address"] = UserHelper::get_user_ip();
diff --git a/include/sessions.php b/include/sessions.php
index 9044c609b..7f61f6dbe 100644
--- a/include/sessions.php
+++ b/include/sessions.php
@@ -106,13 +106,11 @@
}
if (\Config::get_schema_version() >= 0) {
- if (!\Config::get(\Config::SINGLE_USER_MODE)) {
- session_set_save_handler('\Sessions\ttrss_open',
- '\Sessions\ttrss_close', '\Sessions\ttrss_read',
- '\Sessions\ttrss_write', '\Sessions\ttrss_destroy',
- '\Sessions\ttrss_gc');
- register_shutdown_function('session_write_close');
- }
+ session_set_save_handler('\Sessions\ttrss_open',
+ '\Sessions\ttrss_close', '\Sessions\ttrss_read',
+ '\Sessions\ttrss_write', '\Sessions\ttrss_destroy',
+ '\Sessions\ttrss_gc');
+ register_shutdown_function('session_write_close');
if (!defined('NO_SESSION_AUTOSTART')) {
if (isset($_COOKIE[session_name()])) {