From 60c1387a16ea4944674b0c9da2273158d1fbf0b4 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 22 Aug 2010 23:15:43 +0000 Subject: Merged r6757:6810 from 1.7 branch into trunk git-svn-id: http://code.elgg.org/elgg/trunk@6850 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/notifications/settings/usersettings/save.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'actions/notifications/settings/usersettings') diff --git a/actions/notifications/settings/usersettings/save.php b/actions/notifications/settings/usersettings/save.php index 159dd501b..7df0e7e5c 100644 --- a/actions/notifications/settings/usersettings/save.php +++ b/actions/notifications/settings/usersettings/save.php @@ -12,9 +12,16 @@ $method = get_input('method'); gatekeeper(); +$current_settings = get_user_notification_settings(); + $result = false; foreach ($method as $k => $v) { - $result = set_user_notification_setting($_SESSION['user']->guid, $k, ($v == 'yes') ? true : false); + // check if setting has changed and skip if not + if ($current_settings->$k == ($v == 'yes')) { + continue; + } + + $result = set_user_notification_setting(get_loggedin_userid(), $k, ($v == 'yes') ? true : false); if (!$result) { register_error(elgg_echo('notifications:usersettings:save:fail')); @@ -23,6 +30,4 @@ foreach ($method as $k => $v) { if ($result) { system_message(elgg_echo('notifications:usersettings:save:ok')); -} else { - register_error(elgg_echo('notifications:usersettings:save:fail')); -} \ No newline at end of file +} -- cgit v1.2.3