diff options
author | Minteck <contact@minteck.org> | 2023-02-23 14:20:13 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 14:20:13 +0100 |
commit | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (patch) | |
tree | e3f668e635253310b97fb379d71318dc96d1dd2d /pages/metadata.inc | |
parent | 6563d542af0930ebb6b2f9b71f2b7538d7467665 (diff) | |
download | pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.tar.gz pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.tar.bz2 pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.zip |
Updated 27 files, added assets/uploads/pt-twilightsparkle.png and deleted 3 files (automated)
Diffstat (limited to 'pages/metadata.inc')
-rw-r--r-- | pages/metadata.inc | 16 |
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); |