diff options
author | RaindropsSys <raindrops@equestria.dev> | 2024-03-29 22:05:35 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2024-03-29 22:05:35 +0100 |
commit | 5860551daa0f60103ad24e93da29f401a653f144 (patch) | |
tree | 9ad97e04152a6edc11d5096c87880978df39086a /pages/api/rename.php | |
parent | a51979ad60074db84af78a06d30fcb888ccb0b03 (diff) | |
download | pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.tar.gz pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.tar.bz2 pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.zip |
Updated 20 files, added 6 files, deleted 144 files and renamed .idea/ponycule.iml (automated)
Diffstat (limited to 'pages/api/rename.php')
-rw-r--r-- | pages/api/rename.php | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/pages/api/rename.php b/pages/api/rename.php deleted file mode 100644 index 4e01b06..0000000 --- a/pages/api/rename.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; - -header("Content-Type: application/json"); - -if (!$isLoggedIn || $isLowerLoggedIn) { - header("Location: /-/login"); - die(); -} - -$obj = [ - "success" => true -]; - -global $token; -$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"]; - -$request_raw = file_get_contents('php://input'); -$json_object = json_decode($request_raw, true); - -if (json_last_error() === JSON_ERROR_NONE) { - $obj["json_error"] = [ json_last_error(), json_last_error_msg() ]; - if (isset($json_object["name"])) { - $data["name"] = $json_object["name"]; - $obj["json_name"] = $json_object["name"]; - } -} - -$obj["new_name"] = $data["name"]; - -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 |