summaryrefslogtreecommitdiff
path: root/pages/api/me.php
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-03-21 16:21:21 +0100
committerRaindropsSys <contact@minteck.org>2023-03-21 16:21:21 +0100
commit475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd (patch)
tree2cff46debf9c1e13892e7babff9deb6874ecb4b2 /pages/api/me.php
parent7ccc2de87f9e25c715dc09b9aba4eb5c66f80424 (diff)
downloadpluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.gz
pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.bz2
pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.zip
Updated 26 files and added 1074 files (automated)
Diffstat (limited to 'pages/api/me.php')
-rw-r--r--pages/api/me.php28
1 files changed, 23 insertions, 5 deletions
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