login: indicate failure in http status codes
[minimedit.git] / login / index.php
index a966cfa78cc89788ff51e41e4f38b3de3ff6fdca..86af0744a4587ea1d9aeab162384a34cb5371641 100644 (file)
@@ -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.';
        }
 }