diff --git a/website/public/settings.php b/website/public/settings.php index e40f042..9247d26 100644 --- a/website/public/settings.php +++ b/website/public/settings.php @@ -18,7 +18,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { try { switch ($_POST["form"]) { case "profile": - updateSettings(); + checkUpdateSettings(); break; case "password": changePassword(); diff --git a/website/queries/settings.php b/website/queries/settings.php index dfd65a0..9b17d17 100644 --- a/website/queries/settings.php +++ b/website/queries/settings.php @@ -50,6 +50,15 @@ function getPasswordHash() { return $stmt->fetch(); } +function checkUpdateSettings() { + if (empty(test_input($_POST['fname'])) || empty(test_input($_POST['lname']))) { + throw new AngryAlert("Geen voornaam of achternaam."); + return; + } + + updateSettings(); +} + /** * Changes the setting from post. * @throws HappyAlert