diff options
Diffstat (limited to 'pages/api/session.php')
-rw-r--r-- | pages/api/session.php | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/pages/api/session.php b/pages/api/session.php deleted file mode 100644 index 25d833d..0000000 --- a/pages/api/session.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; - -header("Content-Type: application/json"); -global $token; - -if (isset($_GET["raw"])) { - die(json_encode(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token)), true), JSON_PRETTY_PRINT)); -} else { - if (!$isLoggedIn || $isLowerLoggedIn) { - die(json_encode([ - "name" => null, - "created" => null, - "last_seen" => null, - "seen_at" => null - ], JSON_PRETTY_PRINT)); - } - - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token)), true); - - die(json_encode([ - "name" => $data["name"], - "created" => date('c', $data["created"]), - "last_seen" => date('c', $data["last"]), - "seen_at" => array_keys($data["addresses"] ?? []) - ], JSON_PRETTY_PRINT)); -}
\ No newline at end of file |