summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-10 20:51:39 +0200
committerMinteck <contact@minteck.org>2022-10-10 20:51:39 +0200
commit108525534c28013cfe1897c30e4565f9893f3766 (patch)
treedd3e5132971f96ab5f05e7f3f8f6dbbf379a19bd /api
parent2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab (diff)
downloadpluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.gz
pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.bz2
pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.zip
Update
Diffstat (limited to 'api')
-rw-r--r--api/app-images.php2
-rw-r--r--api/cloudburst-banners.php8
-rw-r--r--api/cloudburst-data.php6
-rw-r--r--api/cloudburst-scored.php8
-rw-r--r--api/cloudburst.php2
-rw-r--r--api/data.php4
-rw-r--r--api/docs.php2
-rw-r--r--api/emergency-real.php2
-rw-r--r--api/emergency.php2
-rw-r--r--api/eval.php2
-rw-r--r--api/fronter.php6
-rw-r--r--api/me-picture.php5
-rw-r--r--api/me.php2
-rw-r--r--api/pleasure-real.php6
-rw-r--r--api/pleasure.php6
-rw-r--r--api/pluralkit-integration.php10
-rw-r--r--api/raindrops-banners.php8
-rw-r--r--api/raindrops-data.php6
-rw-r--r--api/raindrops-img.php2
-rw-r--r--api/raindrops-scored.php8
-rw-r--r--api/raindrops.php2
-rw-r--r--api/save-private.php8
-rw-r--r--api/save.php8
-rw-r--r--api/session.php2
-rw-r--r--api/token.php2
-rw-r--r--api/video.php2
-rw-r--r--api/wakeup-real.php6
-rw-r--r--api/wakeup.php6
28 files changed, 66 insertions, 67 deletions
diff --git a/api/app-images.php b/api/app-images.php
index 76b11a0..dea66cb 100644
--- a/api/app-images.php
+++ b/api/app-images.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/api/cloudburst-banners.php b/api/cloudburst-banners.php
index 8bbd575..62e6936 100644
--- a/api/cloudburst-banners.php
+++ b/api/cloudburst-banners.php
@@ -1,13 +1,13 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
-foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) {
+foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) {
if ($member['name'] === "unknown") continue;
if ($member['name'] === "fusion") continue;
if ($member['name'] === "new") continue;
diff --git a/api/cloudburst-data.php b/api/cloudburst-data.php
index c996815..edddd2d 100644
--- a/api/cloudburst-data.php
+++ b/api/cloudburst-data.php
@@ -1,14 +1,14 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
$data["members"] = [];
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
- if (str_starts_with($file, "ynmuc-") && !(str_ends_with($file, "-members.json") || str_ends_with($file, "-fronters.json") || str_ends_with($file, "-general.json") || str_ends_with($file, "-switches.json"))) {
+ if (str_starts_with($file, "ynmuc-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/content.html") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) {
$name = substr(explode(".", $file)[0], 6);
$parts = explode("-", $name);
diff --git a/api/cloudburst-scored.php b/api/cloudburst-scored.php
index 37acbcc..649b4fc 100644
--- a/api/cloudburst-scored.php
+++ b/api/cloudburst-scored.php
@@ -1,9 +1,9 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: application/json");
-die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true), "ynmuc")), JSON_PRETTY_PRINT)); \ No newline at end of file
+die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), "ynmuc")), JSON_PRETTY_PRINT)); \ No newline at end of file
diff --git a/api/cloudburst.php b/api/cloudburst.php
index 3002e00..efdcd73 100644
--- a/api/cloudburst.php
+++ b/api/cloudburst.php
@@ -2,5 +2,5 @@
header("Content-Type: text/plain");
-$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true);
+$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true);
echo($fronters['members'][0]['display_name'] ?? $fronters['members'][0]['name']); \ No newline at end of file
diff --git a/api/data.php b/api/data.php
index 51df59a..0a1b01b 100644
--- a/api/data.php
+++ b/api/data.php
@@ -1,7 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
if (!isset($_GET['f']) || !file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $_GET['f'])) {
diff --git a/api/docs.php b/api/docs.php
index edcd4fb..1c9429b 100644
--- a/api/docs.php
+++ b/api/docs.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; global $_PROFILE;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $_PROFILE;
if (!$isLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
diff --git a/api/emergency-real.php b/api/emergency-real.php
index 06e1813..2dd7172 100644
--- a/api/emergency-real.php
+++ b/api/emergency-real.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/api/emergency.php b/api/emergency.php
index 5c9f32f..e0726e7 100644
--- a/api/emergency.php
+++ b/api/emergency.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/api/eval.php b/api/eval.php
index 4270ed1..cebf38b 100644
--- a/api/eval.php
+++ b/api/eval.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: text/plain");
diff --git a/api/fronter.php b/api/fronter.php
index f962625..0dd6e99 100644
--- a/api/fronter.php
+++ b/api/fronter.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
$system = $_GET['s'] ?? null;
@@ -18,7 +18,7 @@ if (!isset($type) || trim($type) === "")
if (!isset($date) || trim($date) === "" || strlen($date) !== 10 || !preg_match("/[\d-]/i", $date))
header("Location: /?error=Date not found") and die();
-$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-planner.json"), true);
+$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json"), true);
function moveElement(&$array, $a, $b) {
$out = array_splice($array, $a, 1);
@@ -105,6 +105,6 @@ switch ($type) {
break;
}
-file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-planner.json", json_encode($list));
+file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json", json_encode($list));
die(); \ No newline at end of file
diff --git a/api/me-picture.php b/api/me-picture.php
index 636188e..3f0bce0 100644
--- a/api/me-picture.php
+++ b/api/me-picture.php
@@ -1,12 +1,12 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
header("Content-Type: application/json");
-$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE['name'] === "Cloudburst System" ? "ynmuc" : "gdapd") . "-fronters.json"), true);
+$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE['name'] === "Cloudburst System" ? "ynmuc" : "gdapd") . "/fronters.json"), true);
$member = $fronters["members"][0];
if (isset($member["avatar_url"])) {
@@ -15,7 +15,6 @@ if (isset($member["avatar_url"])) {
exec("convert -resize 256x256 -quality 50 \"" . $tempfile . "-original" . "\" \"" . $tempfile . "\"", $output);
echo("data:image/jpg;base64," . base64_encode(file_get_contents($tempfile)));
- //echo(implode("\n", $output));
unlink($tempfile . "-original");
unlink($tempfile);
} else {
diff --git a/api/me.php b/api/me.php
index b0162d3..385e662 100644
--- a/api/me.php
+++ b/api/me.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/api/pleasure-real.php b/api/pleasure-real.php
index fe8896d..27f2fcf 100644
--- a/api/pleasure-real.php
+++ b/api/pleasure-real.php
@@ -1,11 +1,11 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
-$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"];
-$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"];
+$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true)["members"];
+$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/content.html"), true)["members"];
if ($frontCloudburst[0]["id"] === "erknz" && $frontRaindrops[0]["id"] === "qbzxm") {
if ($_PROFILE['login'] === "raindrops") $pony = "Cloudy"; else $pony = "Lavender";
diff --git a/api/pleasure.php b/api/pleasure.php
index cdd49c0..1a561df 100644
--- a/api/pleasure.php
+++ b/api/pleasure.php
@@ -1,11 +1,11 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
-$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"];
-$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"];
+$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true)["members"];
+$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/content.html"), true)["members"];
if ($frontCloudburst[0]["id"] === "erknz" && $frontRaindrops[0]["id"] === "qbzxm") {
if ($_PROFILE['login'] === "raindrops") $pony = "Cloudy"; else $pony = "Lavender";
diff --git a/api/pluralkit-integration.php b/api/pluralkit-integration.php
index 3582df1..2736f67 100644
--- a/api/pluralkit-integration.php
+++ b/api/pluralkit-integration.php
@@ -27,15 +27,15 @@ if ($input['system_id'] === "7d9f543e-f742-40f6-9d07-86c3f2983124") {
$name = "Cloudburst System";
}
-$lastFronter = json_decode(@file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-last.json"), true) ?? "";
+$lastFronter = json_decode(@file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/last.json"), true) ?? "";
if ($input["type"] === "CREATE_SWITCH" || $input["type"] === "UPDATE_SWITCH" || $input["type"] === "DELETE_SWITCH") {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters"));
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches"));
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters"));
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches"));
- $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true);
+ $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true);
$currentFronter = $fronters["members"][0]["id"];
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-last.json", json_encode($currentFronter));
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/last.json", json_encode($currentFronter));
$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"];
diff --git a/api/raindrops-banners.php b/api/raindrops-banners.php
index b2a5ef4..97fc954 100644
--- a/api/raindrops-banners.php
+++ b/api/raindrops-banners.php
@@ -1,13 +1,13 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
-foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) {
+foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) {
if ($member['name'] === "unknown") continue;
if ($member['name'] === "fusion") continue;
if ($member['name'] === "new") continue;
diff --git a/api/raindrops-data.php b/api/raindrops-data.php
index 958fb8f..492f561 100644
--- a/api/raindrops-data.php
+++ b/api/raindrops-data.php
@@ -1,14 +1,14 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
$data["members"] = [];
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
- if (str_starts_with($file, "gdapd-") && !(str_ends_with($file, "-members.json") || str_ends_with($file, "-fronters.json") || str_ends_with($file, "-general.json") || str_ends_with($file, "-switches.json"))) {
+ if (str_starts_with($file, "gdapd-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/fronters.json") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) {
$name = substr(explode(".", $file)[0], 6);
$parts = explode("-", $name);
diff --git a/api/raindrops-img.php b/api/raindrops-img.php
index 3b24d97..6a7484f 100644
--- a/api/raindrops-img.php
+++ b/api/raindrops-img.php
@@ -1,6 +1,6 @@
<?php
-$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true);
+$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true);
$url = isset($fronters['members'][0]) ? ($fronters['members'][0]["avatar_url"] ?? "https://static.equestria.horse/ponies/uploads/raindrops.png") : "https://static.equestria.horse/ponies/uploads/raindrops.png";
file_put_contents("/tmp/temp", file_get_contents($url));
diff --git a/api/raindrops-scored.php b/api/raindrops-scored.php
index 929cdc8..75da62a 100644
--- a/api/raindrops-scored.php
+++ b/api/raindrops-scored.php
@@ -1,9 +1,9 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: application/json");
-die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd")), JSON_PRETTY_PRINT)); \ No newline at end of file
+die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd")), JSON_PRETTY_PRINT)); \ No newline at end of file
diff --git a/api/raindrops.php b/api/raindrops.php
index 9f07aff..c44faa6 100644
--- a/api/raindrops.php
+++ b/api/raindrops.php
@@ -2,5 +2,5 @@
header("Content-Type: text/plain");
-$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true);
+$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true);
echo($fronters['members'][0]['display_name'] ?? $fronters['members'][0]['name']); \ No newline at end of file
diff --git a/api/save-private.php b/api/save-private.php
index 13e3ecf..a7430ad 100644
--- a/api/save-private.php
+++ b/api/save-private.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
@@ -24,12 +24,12 @@ if (!isset($content))
header("Location: /?error=No content") and die();
if ($member !== null && $member !== "null") {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-" . $member . "-private.html";
+ $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member . "-private.html";
} else {
if ($subsystem !== null && $subsystem !== "null") {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-subsystem-" . $subsystem . ".html";
+ $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/" . $system . "-" . $subsystem . ".html";
} else {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-content.html";
+ $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $system . ".html";
}
}
diff --git a/api/save.php b/api/save.php
index f679a71..ed6cc17 100644
--- a/api/save.php
+++ b/api/save.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
@@ -24,12 +24,12 @@ if (!isset($content))
header("Location: /?error=No content") and die();
if ($member !== null && $member !== "null") {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-" . $member . "-content.html";
+ $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member . ".html";
} else {
if ($subsystem !== null && $subsystem !== "null") {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-subsystem-" . $subsystem . ".html";
+ $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/" . $system . "-" . $subsystem . ".html";
} else {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-content.html";
+ $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $system . ".html";
}
}
diff --git a/api/session.php b/api/session.php
index 3cf7cff..55d2fd3 100644
--- a/api/session.php
+++ b/api/session.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
header("Content-Type: text/plain");
die($isLoggedIn ? "VALID" : "ERROR"); \ No newline at end of file
diff --git a/api/token.php b/api/token.php
index 8c18c30..99b9158 100644
--- a/api/token.php
+++ b/api/token.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: text/plain");
diff --git a/api/video.php b/api/video.php
index e960ddf..00c8214 100644
--- a/api/video.php
+++ b/api/video.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
if (isset($_GET['id'])) {
diff --git a/api/wakeup-real.php b/api/wakeup-real.php
index a263bf0..2267a4e 100644
--- a/api/wakeup-real.php
+++ b/api/wakeup-real.php
@@ -1,11 +1,11 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
-$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"];
-$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"];
+$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true)["members"];
+$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
$pony = "somepony";
if ($_PROFILE['login'] === "raindrops") $pony = $frontRaindrops[0]["display_name"]; else $pony = $frontCloudburst[0]["display_name"];
diff --git a/api/wakeup.php b/api/wakeup.php
index 7eb96c3..69b0a68 100644
--- a/api/wakeup.php
+++ b/api/wakeup.php
@@ -1,11 +1,11 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
-$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"];
-$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"];
+$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true)["members"];
+$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
$pony = "somepony";
if ($_PROFILE['login'] === "raindrops") $pony = $frontRaindrops[0]["display_name"]; else $pony = $frontCloudburst[0]["display_name"];