X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/234326791b1e8177eb475bffc5956d7086cfac4e..2013f7a1c3ef61a66f5b158823d19c8e6ade8886:/login/index.php diff --git a/login/index.php b/login/index.php index 978709e..8e36628 100644 --- a/login/index.php +++ b/login/index.php @@ -1,4 +1,5 @@ login) { + $Page->title = 'Inloggen'; if (isset($_REQUEST['goto'])) { + if (empty($message)) http_response_code(403); $target = ltrim($_REQUEST['goto'], '/'); $target = new ArchiveArticle("$target.html"); - if ($target->file) { - if ($target->title) { - $Place['title'] .= ' voor ' . $target->title; - } + $target->index; # run forbidden handler to determine metadata + + if ($target->title) { + $Page->title .= ' voor ' . $target->title; } + $Page->image = $target->image; + $Page->teaser = $target->teaser; } + ob_start(); + require_once 'login/form.inc.php'; + $Page->raw = ob_get_clean(); + $Page->place['warn'] = $message; return TRUE; } if (isset($_REQUEST['goto'])) { - ob_clean(); $target = ltrim($_REQUEST['goto'], '/'); - header("Location: /$target"); - http_response_code(302); - exit; + abort("/$target", 302); } -if (empty($Args) and $User and $User->admin) { +if (isset($Page->raw)) { + print $Page->raw; +} +if (empty($Page->path) and $User->admin) { include_once 'login/admin.html'; } +return;