summaryrefslogtreecommitdiff
path: root/includes/init.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-22 10:29:48 +0100
committerMinteck <contact@minteck.org>2023-02-22 10:29:48 +0100
commitbf2558253637537c2d57765e557bdc0e164c58ee (patch)
tree9c50b253090001183ba574cc073d13f74e273758 /includes/init.inc
parent005bbb3c5b211dbb52cf8dcedac505f8a683cf42 (diff)
downloadpluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.gz
pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.bz2
pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.zip
Updated 23 files, added assets/uploads/pt-princesscelestia.png and renamed assets/uploads/pt-luna.png (automated)
Diffstat (limited to 'includes/init.inc')
-rw-r--r--includes/init.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/init.inc b/includes/init.inc
index 53a6328..391a1bc 100644
--- a/includes/init.inc
+++ b/includes/init.inc
@@ -7,7 +7,7 @@ global $pages;
global $lang; global $pages;
$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true);
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
if (in_array($toplevel, array_keys($pages))) {
$title = $pages[$toplevel]["name"][$lang["_name"]];
@@ -22,7 +22,11 @@ if (in_array($toplevel, array_keys($pages))) {
$readOnly = true;
}
- if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die();
+ if ($pages[$toplevel]["limited"]) {
+ if ((!$isLoggedIn && !$isLowerLoggedIn) || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die();
+ } else {
+ if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die();
+ }
}
} else {
$title = $toplevel;