From 9b2f05228357a34a3c0f2950782835dfeb35086e Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 25 Jan 2023 21:29:24 +0100 Subject: Updated 3 files and added 2 files (automated) --- api/booru-check.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 api/booru-check.php (limited to 'api/booru-check.php') diff --git a/api/booru-check.php b/api/booru-check.php new file mode 100644 index 0000000..b2a3800 --- /dev/null +++ b/api/booru-check.php @@ -0,0 +1,24 @@ + false, + "user" => null +]; + +if (isset($_GET["key"])) { + if (in_array($_GET["key"], $list)) { + $obj["valid"] = true; + + foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens"), function ($i) { return !str_starts_with($i, "."); }) as $token) { + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token), true); + $obj["user"] = $data["login"]; + } + } +} + +die(json_encode($obj)); \ No newline at end of file -- cgit