From e5383a35a842d58611af99b58e072b7c3bd8294b Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Mon, 12 Jun 2023 23:01:36 +0200 Subject: Updated 3 files (automated) --- pages/api/reauthenticate.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'pages/api/reauthenticate.php') 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(); -- cgit