X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/681f9b3b30f07f7e98011fac433fac3e3e93f002..54f21498843819c2d063ce3dd4a450fc006d7301:/login/index.php diff --git a/login/index.php b/login/index.php index a966cfa..66cb0c9 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(); require_once 'login/form.inc.php'; $Place['warn'] = $message; - return TRUE; + $Article->title = 'Inloggen'; + if (isset($_REQUEST['goto'])) { + $target = ltrim($_REQUEST['goto'], '/'); + $target = new ArchiveArticle("$target.html"); + if ($target->title) { + $Article->title .= ' voor ' . $target->title; + } + } + 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'; } +return;