diff options
author | RaindropsSys <contact@minteck.org> | 2023-05-27 17:43:54 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-05-27 17:43:54 +0200 |
commit | a542c7beec172123100bca3c59a42109ee7e2d08 (patch) | |
tree | 77885a791562570975145b47cb75efc2c1540446 /includes/util/session.inc | |
parent | 81f4d57775853615633af0f3c8f7a1f139a64265 (diff) | |
download | pluralconnect-a542c7beec172123100bca3c59a42109ee7e2d08.tar.gz pluralconnect-a542c7beec172123100bca3c59a42109ee7e2d08.tar.bz2 pluralconnect-a542c7beec172123100bca3c59a42109ee7e2d08.zip |
Updated 6 files and added assets/logo/celeste.png (automated)
Diffstat (limited to 'includes/util/session.inc')
-rw-r--r-- | includes/util/session.inc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/includes/util/session.inc b/includes/util/session.inc index 63197bb..7554cfa 100644 --- a/includes/util/session.inc +++ b/includes/util/session.inc @@ -40,10 +40,6 @@ if (isset($token)) { if (isset($data["profile"])) { $_PROFILE = $data["profile"]; - $data["last"] = time(); - if (!isset($data["addresses"])) $data["addresses"] = []; - $data["addresses"][$_SERVER["HTTP_X_FORWARDED_FOR"] ?? $_SERVER["REMOTE_ADDR"]] = time(); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), json_encode($data)); if (time() - $data["last"] > 86400 * 30) { unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)); @@ -51,6 +47,11 @@ if (isset($token)) { $isLoggedIn = false; $isLowerLoggedIn = false; } + + $data["last"] = time(); + if (!isset($data["addresses"])) $data["addresses"] = []; + $data["addresses"][$_SERVER["HTTP_X_FORWARDED_FOR"] ?? $_SERVER["REMOTE_ADDR"]] = time(); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), json_encode($data)); } else { $_PROFILE = $data; } @@ -66,9 +67,6 @@ if (isset($token)) { if (isset($data["profile"])) { $_PROFILE = $data["profile"]; - $data["last"] = time(); - $data["addresses"][$_SERVER["HTTP_X_FORWARDED_FOR"] ?? $_SERVER["REMOTE_ADDR"]] = time(); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), json_encode($data)); if (time() - $data["last"] > 86400 * 30) { unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)); @@ -76,6 +74,10 @@ if (isset($token)) { $isLoggedIn = false; $isLowerLoggedIn = false; } + + $data["last"] = time(); + $data["addresses"][$_SERVER["HTTP_X_FORWARDED_FOR"] ?? $_SERVER["REMOTE_ADDR"]] = time(); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), json_encode($data)); } else { $_PROFILE = $data; } |