add name field check in settings

This commit is contained in:
Hendrik
2017-02-02 15:00:01 +01:00
parent 8a6acbc52a
commit 9426f4d6ac
2 changed files with 10 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
try { try {
switch ($_POST["form"]) { switch ($_POST["form"]) {
case "profile": case "profile":
updateSettings(); checkUpdateSettings();
break; break;
case "password": case "password":
changePassword(); changePassword();

View File

@@ -50,6 +50,15 @@ function getPasswordHash() {
return $stmt->fetch(); 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. * Changes the setting from post.
* @throws HappyAlert * @throws HappyAlert