From 5dbc0606ca657c9dfb144dc6e702598ee3a84878 Mon Sep 17 00:00:00 2001 From: Phyks Date: Sat, 28 Sep 2013 19:35:13 +0200 Subject: [PATCH] Backend for e-mail notifications. Actual sending of e-mail TODO --- index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 11c6d5a..41a03ad 100644 --- a/index.php +++ b/index.php @@ -163,7 +163,7 @@ break; case 'password': - if(!empty($_POST['email'])) { + if(!empty($_POST['email']) && !empty($_POST['notifications'])) { if(check_token(600, 'password')) { if(!empty($_POST['password']) && !empty($_POST['password_confirm'])) { if($_POST['password'] == $_POST['password_confirm']) { @@ -180,6 +180,7 @@ $tpl->assign('error', $errors['email_invalid'][LANG]); } + $current_user->setNotifications($_POST['notifications']); $current_user->save(); if(!empty($error)) { @@ -205,7 +206,7 @@ exit(); } - if(!empty($_POST['login']) && !empty($_POST['display_name']) && !empty($_POST['email']) && (!empty($_POST['password']) || !empty($_POST['user_id'])) && isset($_POST['admin'])) { + if(!empty($_POST['login']) && !empty($_POST['display_name']) && !empty($_POST['email']) && (!empty($_POST['password']) && !empty($_POST['notifications']) || !empty($_POST['user_id'])) && isset($_POST['admin'])) { if(check_token(600, 'edit_users')) { $user = new User(); if(!empty($_POST['user_id'])) { @@ -223,6 +224,8 @@ if($user->setEmail($_POST['email']) !== false) { if(!empty($_POST['user_id']) || $user->isUnique()) { + $user->setNotifications($_POST['notifications']); + $user->save(); // Clear the cache