X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/0c5eed59b9187f54cedadc383bf2326f5ba354e0..b04f76050d54c67844d5d4026993f6fab0edeae5:/login/index.php diff --git a/login/index.php b/login/index.php index 86af074..e1f0cae 100644 --- a/login/index.php +++ b/login/index.php @@ -35,22 +35,48 @@ elseif (isset($_GET['logout'])) { $message = "Je bent uitgelogd. Graag tot ziens!"; } -if (empty($User)) { - ob_clean(); +if (!$User or !$User->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 and $target->handler == 'melding') { + $caller = $Page; + $Page = $target; + ob_start(); + include "./{$target->handler}/index.php"; + ob_end_clean(); + $Page = $caller; + } + + if ($target->title) { + $Page->title .= ' voor ' . $target->title; + } + if ($target->image) { + $Page->image = $target->image; + } + } + 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'], '/'); +if (isset($_REQUEST['goto'])) { + $target = ltrim($_REQUEST['goto'], '/'); header("Location: /$target"); http_response_code(302); exit; } -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'; } +return;