diff options
author | RaindropsSys <contact@minteck.org> | 2023-06-12 23:01:36 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-06-12 23:01:36 +0200 |
commit | e5383a35a842d58611af99b58e072b7c3bd8294b (patch) | |
tree | 44ac5c6d40a5d4f21fcb2db50483416ad92386e1 /pages/api | |
parent | 6679588e43b0f694421d48e4ddb071972a127dca (diff) | |
download | pluralconnect-e5383a35a842d58611af99b58e072b7c3bd8294b.tar.gz pluralconnect-e5383a35a842d58611af99b58e072b7c3bd8294b.tar.bz2 pluralconnect-e5383a35a842d58611af99b58e072b7c3bd8294b.zip |
Updated 3 files (automated)
Diffstat (limited to 'pages/api')
-rw-r--r-- | pages/api/reauthenticate.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pages/api/reauthenticate.php b/pages/api/reauthenticate.php index fe10d28..2b5a8ca 100644 --- a/pages/api/reauthenticate.php +++ b/pages/api/reauthenticate.php @@ -14,7 +14,13 @@ $newToken = generateToken(); if (isset($_COOKIE['PEH2_SESSION_TOKEN']) && $isLoggedIn) { $old = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $_COOKIE['PEH2_SESSION_TOKEN']), true); - $old["name"] = base64_decode($_GET["name"] ?? "LQo="); + + if (!isset($_GET["plain"])) { + $old["name"] = base64_decode($_GET["name"] ?? "LQo="); + } else { + $old["name"] = $_GET["name"] ?? "-"; + } + $old["created"] = time(); $old["addresses"] = []; $old["last"] = time(); @@ -23,7 +29,13 @@ if (isset($_COOKIE['PEH2_SESSION_TOKEN']) && $isLoggedIn) { file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $newToken, json_encode($old)); } else if (isset($_COOKIE['PEH2_SESSION_TOKEN']) && $isLowerLoggedIn) { $old = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $_COOKIE['PEH2_SESSION_TOKEN']), true); - $old["name"] = base64_decode($_GET["name"] ?? "LQo="); + + if (!isset($_GET["plain"])) { + $old["name"] = base64_decode($_GET["name"] ?? "LQo="); + } else { + $old["name"] = $_GET["name"] ?? "-"; + } + $old["created"] = time(); $old["addresses"] = []; $old["last"] = time(); |