add name field check in settings
This commit is contained in:
@@ -18,7 +18,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
try {
|
||||
switch ($_POST["form"]) {
|
||||
case "profile":
|
||||
updateSettings();
|
||||
checkUpdateSettings();
|
||||
break;
|
||||
case "password":
|
||||
changePassword();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user