From 475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Tue, 21 Mar 2023 16:21:21 +0100 Subject: Updated 26 files and added 1074 files (automated) --- pages/api/me.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'pages/api/me.php') diff --git a/pages/api/me.php b/pages/api/me.php index 215e1cf..4f86549 100644 --- a/pages/api/me.php +++ b/pages/api/me.php @@ -3,19 +3,37 @@ $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; -if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die(); -global $_PROFILE; header("Content-Type: application/json"); +if (!$isLoggedIn && !$isLowerLoggedIn) die('{"valid": false}'); +global $_PROFILE; + if ($_PROFILE['login'] === "raindrops") { - die('{"name": "Raindrops System", "id": "raindrops", "pluralkit": "gdapd"}'); + die(json_encode([ + "valid" => true, + "name" => "Raindrops System", + "id" => "raindrops", + "pluralkit" => "gdapd", + "avatar" => getAsset("gdapd"), + "email" => $_PROFILE["profile"]["email"]["email"] + ])); } else if ($_PROFILE["login"] === "cloudburst") { - die('{"name": "Cloudburst System", "id": "cloudburst", "pluralkit": "ynmuc"}'); + die(json_encode([ + "valid" => true, + "name" => "Cloudburst System", + "id" => "cloudburst", + "pluralkit" => "ynmuc", + "avatar" => getAsset("ynmuc"), + "email" => $_PROFILE["profile"]["email"]["email"] + ])); } else { die(json_encode([ + "valid" => true, "name" => $app["other"]["name"], "id" => $app["other"]["slug"], - "pluralkit" => $app["other"]["id"] + "pluralkit" => $app["other"]["id"], + "avatar" => getAsset($app["other"]["id"]), + "email" => $_PROFILE["profile"]["email"]["email"] ])); } \ No newline at end of file -- cgit