X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/85536cb70f85743054b6b3abfc36d05662e6878d..2013f7a1c3ef61a66f5b158823d19c8e6ade8886:/login/index.php diff --git a/login/index.php b/login/index.php index 40fcb61..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"); + $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'; - $Place['warn'] = $message; + $Page->raw = ob_get_clean(); + $Page->place['warn'] = $message; return TRUE; } -if (isset($_GET['goto'])) { - ob_clean(); - $target = ltrim($_GET['goto'], '/'); - header("Location: /$target"); - http_response_code(302); - exit; +if (isset($_REQUEST['goto'])) { + $target = ltrim($_REQUEST['goto'], '/'); + abort("/$target", 302); } -if (empty($Args) and !empty($User['admin'])) { +if (isset($Page->raw)) { + print $Page->raw; +} +if (empty($Page->path) and $User->admin) { include_once 'login/admin.html'; - include_once 'login/admin/index.php'; } + +return;