diff options
Diffstat (limited to 'pages/api')
-rw-r--r-- | pages/api/rename.php | 4 | ||||
-rw-r--r-- | pages/api/session.php | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pages/api/rename.php b/pages/api/rename.php index 3aab034..4e01b06 100644 --- a/pages/api/rename.php +++ b/pages/api/rename.php @@ -15,7 +15,7 @@ $obj = [ ]; global $token; -$data = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token))), true); +$data = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token))), true); $data["name"] = $_POST["name"] ?? $_GET["name"] ?? $data["name"]; $obj["pre_name"] = $data["name"]; @@ -33,5 +33,5 @@ if (json_last_error() === JSON_ERROR_NONE) { $obj["new_name"] = $data["name"]; -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), pf_utf8_encode(json_encode($data))); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token), pf_utf8_encode(json_encode($data))); die(json_encode($obj));
\ No newline at end of file diff --git a/pages/api/session.php b/pages/api/session.php index d410c10..25d833d 100644 --- a/pages/api/session.php +++ b/pages/api/session.php @@ -7,9 +7,9 @@ header("Content-Type: application/json"); global $token; if (isset($_GET["raw"])) { - die(json_encode(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true), JSON_PRETTY_PRINT)); + die(json_encode(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token)), true), JSON_PRETTY_PRINT)); } else { - if (!$isLoggedIn || $isLowerLoggedIn) { + if (!$isLoggedIn || $isLowerLoggedIn) { die(json_encode([ "name" => null, "created" => null, @@ -18,7 +18,7 @@ if (isset($_GET["raw"])) { ], JSON_PRETTY_PRINT)); } - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true); + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token)), true); die(json_encode([ "name" => $data["name"], |