diff options
author | RaindropsSys <contact@minteck.org> | 2023-08-02 14:08:08 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-08-02 14:08:08 +0200 |
commit | 5103495a461ed90f23b5ec890dca73935bff0c68 (patch) | |
tree | adc16bfa325372623d6f58c3befa28bb25b72cec /pages/api | |
parent | 0406b656d04a6fffbcc5f6d16ecec9906cc3b609 (diff) | |
download | pluralconnect-5103495a461ed90f23b5ec890dca73935bff0c68.tar.gz pluralconnect-5103495a461ed90f23b5ec890dca73935bff0c68.tar.bz2 pluralconnect-5103495a461ed90f23b5ec890dca73935bff0c68.zip |
Updated 19 files and added assets/icons/new/menu.svg (automated)
Diffstat (limited to 'pages/api')
-rw-r--r-- | pages/api/docs.php | 8 | ||||
-rw-r--r-- | pages/api/reauthenticate.php | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/pages/api/docs.php b/pages/api/docs.php index a60a6e6..31cd961 100644 --- a/pages/api/docs.php +++ b/pages/api/docs.php @@ -20,10 +20,10 @@ if (isset($select)) { die("Not set"); } -if ($json_object["content"]) $data["contents"] = $json_object["content"]; -if ($json_object["name"]) $data["name"] = $json_object["name"]; -if ($json_object["explicit"]) $data["nsfw"] = $json_object["explicit"]; -if ($json_object["category"]) $data["category"] = trim($json_object["category"]) !== "" && trim($json_object["category"]) !== "Unsorted" && trim($json_object["category"]) !== "unsorted" && trim($json_object["category"]) !== "/no" && trim($json_object["category"]) !== "Unsort" && trim($json_object["category"]) !== "unsort" ? $json_object["category"] : null; +if (isset($json_object["content"])) $data["contents"] = $json_object["content"]; +if (isset($json_object["name"])) $data["name"] = $json_object["name"]; +if (isset($json_object["explicit"])) $data["nsfw"] = $json_object["explicit"]; +if (isset($json_object["category"])) $data["category"] = trim($json_object["category"]) !== "" && trim($json_object["category"]) !== "Unsorted" && trim($json_object["category"]) !== "unsorted" && trim($json_object["category"]) !== "/no" && trim($json_object["category"]) !== "Unsort" && trim($json_object["category"]) !== "unsort" ? $json_object["category"] : null; $data["last"]["date"] = time(); $data["last"]["author"] = $_PROFILE['login']; diff --git a/pages/api/reauthenticate.php b/pages/api/reauthenticate.php index 2b5a8ca..b194098 100644 --- a/pages/api/reauthenticate.php +++ b/pages/api/reauthenticate.php @@ -26,9 +26,10 @@ if (isset($_COOKIE['PEH2_SESSION_TOKEN']) && $isLoggedIn) { $old["last"] = time(); $old["profile"] = $_PROFILE; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $newToken, json_encode($old)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $newToken, json_encode($old)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $newToken, json_encode($_PROFILE)); } 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 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $_COOKIE['PEH2_SESSION_TOKEN']), true); if (!isset($_GET["plain"])) { $old["name"] = base64_decode($_GET["name"] ?? "LQo="); @@ -41,7 +42,8 @@ if (isset($_COOKIE['PEH2_SESSION_TOKEN']) && $isLoggedIn) { $old["last"] = time(); $old["profile"] = $_PROFILE; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $newToken, json_encode($old)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $newToken, json_encode($old)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $newToken, json_encode($_PROFILE)); } die($newToken);
\ No newline at end of file |