From e68f7733ec6b846dc82b67e52588ae0ba302b76b Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 15 Sep 2017 15:42:59 +0200 Subject: [PATCH] page: edit template in static contents Allow post-processing by relevant scripts. --- page.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/page.php b/page.php index 9e3388e..3c0977e 100644 --- a/page.php +++ b/page.php @@ -52,6 +52,9 @@ if (file_exists("$Page$Args/index.html")) { elseif (file_exists("$Page$Args.html")) { $found = include "./$Page$Args.html"; } +elseif (isset($User) and $User['admin']) { + $found = require './template.html'; +} print "\n\n"; @@ -76,14 +79,9 @@ include_once 'page.inc.php'; if (!$found) { # no resulting output - if (isset($User) and $User['admin']) { - require './template.html'; - } - else { - http_response_code(404); - ob_start(); - require "./404.html"; - print getoutput([ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']) ]); - } + http_response_code(404); + ob_start(); + require "./404.html"; + print getoutput([ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']) ]); } -- 2.30.0