add name field check in settings
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user