diff options
Diffstat (limited to 'dash/settings.php')
| -rw-r--r-- | dash/settings.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/dash/settings.php b/dash/settings.php index c17a6dd..b27122d 100644 --- a/dash/settings.php +++ b/dash/settings.php @@ -5,7 +5,7 @@ require('dash_common.php'); global $b_config, $b_user; $title = 'Account Settings / Bulletin'; require('header.php'); -if (!empty($_POST['oldpass'])) { +if (!empty($_POST['change'])) { if ($b_user['password'] != hash('sha512', $_POST['oldpass'])) dash_fatal('The password you entered does not match your current password.'); if (!empty($_POST['newpass1'])) { if ($_POST['newpass1'] != $_POST['newpass2']) dash_fatal('Your new passwords do not match.'); @@ -20,12 +20,17 @@ if (!empty($_POST['oldpass'])) { $db->query('UPDATE users SET type = \''.$type.'\' WHERE id = '.$b_user['id']) or dash_fatal($db->error); if ($db->affected_rows < 1) dash_fatal('Your account type could not be changed.'); } - dash_fatal('Account settings successfully updated.'); + + if ($_POST['notif'] != $b_user['notify']) { + $notif = is_null($_POST['notif']) ? '0' : '1'; + $db->query('UPDATE users SET notify = '.$notif.' WHERE id = '.$b_user['id']) or dash_fatal($db->error); + } + dash_fatal('Account settings successfully updated.', $b_config['base_url'].'dash/settings.php'); } ?> <div id="fulljob" class="fjsettings"> <div id="fjheader"> - <h3 id="fjhtitle">Account Settings</h3> + <h3 id="fjhtitle"><a href="settings.php">Account Settings</a></h3> <p id="fjhdesc">Adjusting for <?=htmlentities($b_user['email']);?></p> </div> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post"> @@ -49,6 +54,10 @@ if (!empty($_POST['oldpass'])) { </select> </p> </div> + <div class="pseudoform"> + <h4>Email Notifications</h4> + <p><input id="inpnotif" type="checkbox" name="notif" <?=$b_user['notify'] ? ' checked="checked"' : '';?> /><label for="inpnotif">Send me account-related notifications via email.</label></p> + </div> <p id="setchgbtn"><input id="inpchg" type="submit" name="change" value="Update Settings" /></p> </div> </form> |
