summaryrefslogtreecommitdiff
path: root/pages/api/me.php
blob: 817b1066f0c6c9435d4bb1ce9438e79e9251aa96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);

require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;

header("Content-Type: application/json");

if ($_PROFILE['login'] === "raindrops") {
    die('{"name": "Raindrops System", "id": "raindrops", "pluralkit": "gdapd"}');
} else if ($_PROFILE["login"] === "cloudburst") {
    die('{"name": "Cloudburst System", "id": "cloudburst", "pluralkit": "ynmuc"}');
} else {
    die(json_encode([
        "name" => $app["other"]["name"],
        "id" => $app["other"]["slug"],
        "pluralkit" => $app["other"]["id"]
    ]));
}