<?php global $title; global $toplevel; global $emergencyHeader; 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/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; if (in_array($toplevel, array_keys($pages))) { $title = $pages[$toplevel]["name"][$lang["_name"]]; if ($pages[$toplevel]["admin"]) { $readOnly = false; @file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test", "hello"); if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test")) { unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test"); } else { $readOnly = true; } 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; }