summaryrefslogtreecommitdiff
path: root/pages/api/session.php
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-03-29 22:05:35 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-03-29 22:05:35 +0100
commit5860551daa0f60103ad24e93da29f401a653f144 (patch)
tree9ad97e04152a6edc11d5096c87880978df39086a /pages/api/session.php
parenta51979ad60074db84af78a06d30fcb888ccb0b03 (diff)
downloadpluralconnect-5860551daa0f60103ad24e93da29f401a653f144.tar.gz
pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.tar.bz2
pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.zip
Updated 20 files, added 6 files, deleted 144 files and renamed .idea/ponycule.iml (automated)
Diffstat (limited to 'pages/api/session.php')
-rw-r--r--pages/api/session.php29
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