diff options
Diffstat (limited to 'includes/init.inc')
-rw-r--r-- | includes/init.inc | 8 |
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; |