X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/8c48d7e676efc23118ce2631642126c869ce4efb..61170ad9e7bd42ea74fed5d5fe5b7227e28a0cc2:/page.php diff --git a/page.php b/page.php index e2043ed..38f54ec 100644 --- a/page.php +++ b/page.php @@ -2,6 +2,9 @@ error_reporting(E_ALL); ini_set('display_errors', TRUE); +include_once 'auth.inc.php'; +$Edit = isset($_GET['edit']); + $Args = ''; $Page = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']); $Page = urldecode(trim($Page, '/')) ?: 'index'; @@ -16,11 +19,15 @@ while (TRUE) { if (file_exists("$Page.php")) { # unformatted script override require "$Page.php"; - break; + exit; } $up = strrpos($Page, '/'); if ($up === FALSE) { + if ($User['admin']) { + $Page = 'template'; + break; + } http_response_code(404); $Page = '404'; break; @@ -29,6 +36,4 @@ while (TRUE) { $Page = substr($Page, 0, $up); } -$Edit = isset($_GET['edit']); - -include 'head.inc.php'; +include 'page.inc.php';