summaryrefslogtreecommitdiff
path: root/app.php
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 /app.php
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 'app.php')
-rw-r--r--app.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/app.php b/app.php
index 7bfbe29..a6e17d9 100644
--- a/app.php
+++ b/app.php
@@ -1,6 +1,9 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/language.inc"; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+
+$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
if (str_ends_with($_GET['_'], "/")) {
$pagename = substr($_GET['_'], 0, strlen($_GET['_']) - 1);
@@ -36,7 +39,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) {
$pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc";
}
- } else if ($toplevel === "cloudburst" || $toplevel === "raindrops") {
+ } else if ($toplevel === "cloudburst" || $toplevel === "raindrops" || (($isLoggedIn || $isLowerLoggedIn) && $toplevel === $app["other"]["slug"])) {
$parts = explode("/", $_GET['_']);
if (isset($parts[1]) && $parts[1] !== "-") {
@@ -65,8 +68,15 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) {
$namesRaindrops = [...array_map(function ($i) {
return $i['name'];
}, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"];
+ $namesOther = [];
+
+ if ($isLoggedIn || $isLowerLoggedIn) {
+ $namesOther = [...array_map(function ($i) {
+ return $i['name'];
+ }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true)), $app["other"]["unknown"]];
+ }
- if ((in_array($toplevel, $namesCloudburst) || in_array($toplevel, $namesRaindrops)) && $toplevel !== "unknown") {
+ if ((in_array($toplevel, $namesCloudburst) || in_array($toplevel, $namesRaindrops) || in_array($toplevel, $namesOther)) && $toplevel !== "unknown") {
$pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc";
} else {