Changed Alerts to Exceptions.

This commit is contained in:
Marijn Jansen
2017-01-24 12:12:48 +01:00
parent 80f7c24641
commit 62a2b32c95
3 changed files with 82 additions and 73 deletions

View File

@@ -12,23 +12,30 @@
</head>
<body>
<?php
$notImplemented = new settingsMessage("angry", "Deze functie werkt nog niet :(");
$notImplemented = new SettingsMessage("angry", "Deze functie werkt nog niet :(");
$alertClass;
$alertMessage;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
switch ($_POST["form"]) {
case "profile":
$result = updateSettings();
break;
case "password":
$result = changePassword();
break;
case "email":
$result = changeEmail();
break;
case "picture":
updateProfilePicture();
$result = new settingsMessage("happy", "Deze melding doet nog niks nuttigs.");
break;
try {
switch ($_POST["form"]) {
case "profile":
$result = updateSettings();
break;
case "password":
$result = changePassword();
break;
case "email":
$result = changeEmail();
break;
case "picture":
updateAvatar();
$result = new SettingsMessage("happy", "Deze melding doet nog niks nuttigs.");
break;
}
} catch (SettingsWarning $w) {
$alertClass = $w->getClass();
$alertMessage = $w->getMessage();
}
}
include("../views/main.php");