diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-07 22:15:48 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-07 22:15:48 +0100 |
commit | 5385f0ed8fbb4325203a222a75e6700ffb519349 (patch) | |
tree | e0fd07ae8abe7ef40eb58cf3c45cfa7a024e863b /pages | |
parent | 65a38d43f056944525d89c18f0137eae58f60e83 (diff) | |
download | pluralconnect-5385f0ed8fbb4325203a222a75e6700ffb519349.tar.gz pluralconnect-5385f0ed8fbb4325203a222a75e6700ffb519349.tar.bz2 pluralconnect-5385f0ed8fbb4325203a222a75e6700ffb519349.zip |
Updated 3 files and added pages/api/me.php (automated)
Diffstat (limited to 'pages')
-rw-r--r-- | pages/api/computer.php | 2 | ||||
-rw-r--r-- | pages/api/me.php | 21 | ||||
-rw-r--r-- | pages/computers.inc | 16 |
3 files changed, 22 insertions, 17 deletions
diff --git a/pages/api/computer.php b/pages/api/computer.php index cd065e7..d3ec15a 100644 --- a/pages/api/computer.php +++ b/pages/api/computer.php @@ -47,4 +47,4 @@ switch ($_GET['type']) { break; } -die("OK");
\ No newline at end of file +die($_PROFILE['login'] . "-" . $host);
\ No newline at end of file diff --git a/pages/api/me.php b/pages/api/me.php new file mode 100644 index 0000000..817b106 --- /dev/null +++ b/pages/api/me.php @@ -0,0 +1,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"] + ])); +}
\ No newline at end of file diff --git a/pages/computers.inc b/pages/computers.inc index 0d41a23..56a1b5d 100644 --- a/pages/computers.inc +++ b/pages/computers.inc @@ -342,22 +342,6 @@ if (count($parts) === 2 || count($parts) === 3) { <tbody> <?php - function prettySize($bytes) { - if ($bytes > 1024) { - if ($bytes > 1024**2) { - if ($bytes > 1024**3) { - return round($bytes / 1024**3, 1) . " GB"; - } else { - return round($bytes / 1024**2, 1) . " MB"; - } - } else { - return round($bytes / 1024, 1) . " KB"; - } - } else { - return $bytes . " B"; - } - } - uasort($computer["filesystems"], function ($a, $b) { return $b["use"] - $a["use"]; }); |