X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/85536cb70f85743054b6b3abfc36d05662e6878d..8f0144192a6b624de74bb73e1a73cc16bd4b09e1:/login/index.php diff --git a/login/index.php b/login/index.php index 40fcb61..d2f22ac 100644 --- a/login/index.php +++ b/login/index.php @@ -10,10 +10,12 @@ if (isset($_POST['mail'])) { $message = "Er is een e-mail verstuurd naar $inputq."; } else { + http_response_code(404); $message = "E-mailadres $inputq is nergens ingesteld."; } } catch (Exception $e) { + http_response_code(500); $message = "E-mail kon niet verstuurd worden." . " Probeer het later nog eens of neem contact op."; } @@ -23,6 +25,7 @@ elseif (isset($_POST['login'])) { login_setcookie(); } else { + http_response_code(403); $message = 'Ongeldige gebruikersnaam of wachtwoord.'; } } @@ -33,21 +36,31 @@ elseif (isset($_GET['logout'])) { } if (empty($User)) { - ob_clean(); + $Article->title = 'Inloggen'; + if (isset($_REQUEST['goto'])) { + $target = ltrim($_REQUEST['goto'], '/'); + $target = new ArchiveArticle("$target.html"); + if ($target->title) { + $Article->title .= ' voor ' . $target->title; + } + } require_once 'login/form.inc.php'; $Place['warn'] = $message; - return TRUE; + return; } -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($Article->raw)) { + print $Article->raw; +} +if (empty($Args) and $User and $User->admin) { include_once 'login/admin.html'; - include_once 'login/admin/index.php'; } + +return;