summaryrefslogtreecommitdiff
path: root/pages/edit.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 14:20:13 +0100
committerMinteck <contact@minteck.org>2023-02-23 14:20:13 +0100
commit8cc1f13c17fa2fb5a4410542d39e650e02945634 (patch)
treee3f668e635253310b97fb379d71318dc96d1dd2d /pages/edit.inc
parent6563d542af0930ebb6b2f9b71f2b7538d7467665 (diff)
downloadpluralconnect-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/edit.inc')
-rw-r--r--pages/edit.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/pages/edit.inc b/pages/edit.inc
index 021ae4b..afaddd3 100644
--- a/pages/edit.inc
+++ b/pages/edit.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 $isLowerLoggedIn; global $title; global $isLoggedIn; global $lang; global $pages; global $app;
if (!isset($_GET['_']) || trim($_GET['_']) === "") header("Location: /?error=Invalid request") and die();
@@ -23,12 +23,16 @@ 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 === "raindrops" ? "Raindrops System" : $app["other"]["name"]);
+$systemID = $system === "cloudburst" ? "ynmuc" : ($system === "raindrops" ? "gdapd" : $app["other"]["id"]);
$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? [];
+if ($isLowerLoggedIn && $systemID !== $app["other"]["id"]) {
+ header("Location: /") and die();
+}
+
if ($member === null) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/sysedit.inc';
} else {
@@ -58,7 +62,7 @@ if ($member === null) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/subsysedit.inc';
} else {
- header("Location: /?error=System member or subsystem not found: " . $subsystemID) and die();
+ header("Location: /?error=System member or subsystem not found") and die();
}
}