From 953ddd82e48dd206cef5ac94456549aed13b3ad5 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 17 Nov 2023 23:25:29 +0100 Subject: Updated 30 files and deleted 2976 files (automated) --- pages/api/disconnect.php | 12 ++++++++++-- pages/api/pluralkit-integration.php | 10 +++------- pages/api/save-private.php | 35 ----------------------------------- pages/api/save.php | 37 ------------------------------------- pages/api/timeline.php | 2 +- 5 files changed, 14 insertions(+), 82 deletions(-) delete mode 100644 pages/api/save-private.php delete mode 100644 pages/api/save.php (limited to 'pages/api') diff --git a/pages/api/disconnect.php b/pages/api/disconnect.php index c4cf0bd..ffd3f40 100644 --- a/pages/api/disconnect.php +++ b/pages/api/disconnect.php @@ -13,13 +13,21 @@ $list = array_filter([...scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens") $session = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token) ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token), true) : json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token), true); - return isset($session["last"]) && isset($session["profile"]) && ($session["profile"]["id"] ?? "") === ($_PROFILE["id"] ?? ""); + return isset($session["id"]) && $session["id"] === ($_PROFILE["id"] ?? ""); }); +var_dump($list); + foreach ($list as $token) { $session = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token) ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token), true) : json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token), true); - if (isset($_GET["id"]) && sha1($token) . md5($token) === $_GET["id"]) { + var_dump(bin2hex(substr($token, 0, 50)), trim($_GET["id"])); + + if (bin2hex(substr($token, 0, 50)) === trim($_GET["id"])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $token)) { + unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $token); + } + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token)) { unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token); } else { diff --git a/pages/api/pluralkit-integration.php b/pages/api/pluralkit-integration.php index 69d99b1..7d7c641 100644 --- a/pages/api/pluralkit-integration.php +++ b/pages/api/pluralkit-integration.php @@ -8,12 +8,6 @@ $inputJSON = file_get_contents('php://input'); $input = json_decode($inputJSON, true); $data = $GLOBALS["ColdHazeApp"]["webhook"]; -if (isset($GLOBALS["ColdHazeApp"]["ponytown"][$user])) { - $ponytown = $GLOBALS["ColdHazeApp"]["ponytown"][$user]; -} else { - header("HTTP/1.1 404 Not Found") and die(); -} - if ($user === null) { header("HTTP/1.1 500 Internal Server Error") and die(); } @@ -32,6 +26,9 @@ if ($input['system_id'] === "7d9f543e-f742-40f6-9d07-86c3f2983124") { } elseif ($input['system_id'] === "ade46823-206b-4b0c-ad3c-caae934a5f3b") { $system = "ynmuc"; $name = "Cloudburst System"; +} elseif ($input['system_id'] === "d1cd97eb-9c92-4e42-94cd-4397a5074ff9") { + $system = "hrbom"; + $name = "Moonglow"; } elseif (isset($app["other"]) && $input["system_id"] === $app["other"]["uuid"]) { $system = $app["other"]["id"]; $name = $app["other"]["name"]; @@ -48,7 +45,6 @@ if ($input["type"] === "CREATE_MEMBER" || $input["type"] === "UPDATE_MEMBER" || createJob("UpdateAssets", [ "type" => "members" ]); - createJob("UpdateLogo", []); } if ($input["type"] === "UPDATE_SYSTEM") { diff --git a/pages/api/save-private.php b/pages/api/save-private.php deleted file mode 100644 index 6843e2a..0000000 --- a/pages/api/save-private.php +++ /dev/null @@ -1,35 +0,0 @@ -