summaryrefslogtreecommitdiff
path: root/pages/metadata.inc
diff options
context:
space:
mode:
Diffstat (limited to 'pages/metadata.inc')
-rw-r--r--pages/metadata.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/pages/metadata.inc b/pages/metadata.inc
index 5e2c452..0a987f3 100644
--- a/pages/metadata.inc
+++ b/pages/metadata.inc
@@ -13,7 +13,7 @@ function getSubsystemByID(string $id) {
return $subsystem;
}
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLowerLoggedIn; global $isLoggedIn; global $lang; global $pages; global $app;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
@@ -25,14 +25,20 @@ array_shift($parts);
$system = $parts[0];
$member = !isset($parts[1]) || $parts[1] === "" ? null : $parts[1];
-if ($system !== "cloudburst" && $system !== "raindrops") header("Location: /?error=Invalid system name: " . $system) and die();
-$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System";
-$systemID = $system === "cloudburst" ? "ynmuc" : "gdapd";
+if ($system !== "cloudburst" && $system !== "raindrops" && $system !== $app["other"]["slug"]) header("Location: /?error=Invalid system name: " . $system) and die();
+$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] ? $app["other"]["name"] : "Raindrops System");
+$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] ? $app["other"]["id"] : "gdapd");
$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? [];
+if ($isLowerLoggedIn && $systemID !== $app["other"]["id"]) {
+ header("Location: /");
+ die();
+}
+
if ($member === null) {
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/sysedit.inc';
+ header("Location: /");
+ die();
} else {
$isSubsystem = false;
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true);