X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/681f9b3b30f07f7e98011fac433fac3e3e93f002..41811556ca2ca3ca29191bee012c35e5f40a3995:/login/index.php diff --git a/login/index.php b/login/index.php index a966cfa..5cfbded 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.'; } } @@ -36,18 +39,26 @@ if (empty($User)) { ob_clean(); require_once 'login/form.inc.php'; $Place['warn'] = $message; + $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 TRUE; } -if (isset($_GET['goto'])) { +if (isset($_REQUEST['goto'])) { ob_clean(); - $target = ltrim($_GET['goto'], '/'); + $target = ltrim($_REQUEST['goto'], '/'); header("Location: /$target"); http_response_code(302); exit; } -if (empty($Args) and !empty($User['admin'])) { +if (empty($Args) and $User and $User->admin) { include_once 'login/admin.html'; }