Browse Source

Merge pull request #1032 from Arantor/release-2.1

Some more alerts fixes
Arantor 11 years ago
parent
commit
12f63487fb
3 changed files with 5 additions and 4 deletions
  1. 3 2
      Sources/Profile-Modify.php
  2. 1 1
      Sources/Subs.php
  3. 1 1
      Sources/tasks/Register-Notify.php

+ 3 - 2
Sources/Profile-Modify.php

@@ -1846,6 +1846,8 @@ function alert_configuration($memID)
 {
 	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir, $settings;
 
+	$context['token_check'] = 'profile-nt' . $memID;
+
 	// What options are set?
 	$context['member'] += array(
 		'notify_announcements' => $user_profile[$memID]['notify_announcements'],
@@ -1978,13 +1980,12 @@ function alert_configuration($memID)
 		if (!$context['member']['is_owner'])
 			isAllowedTo('profile_extra_any');
 		checkSession('post');
-		validateToken(str_replace('%u', $memID, 'profile-nt%u'), 'post');
+		validateToken($context['token_check'], 'post');
 
 		makeNotificationChanges($memID);
 		$context['profile_updated'] = $txt['profile_updated_own'];
 	}
 
-	$context['token_check'] = str_replace('%u', $memID, 'profile-nt%u');
 	createToken($context['token_check'], 'post');
 }
 

+ 1 - 1
Sources/Subs.php

@@ -288,7 +288,7 @@ function updateMemberData($members, $data)
 	$knownInts = array(
 		'date_registered', 'posts', 'id_group', 'last_login', 'instant_messages', 'unread_messages',
 		'new_pm', 'pm_prefs', 'gender', 'hide_email', 'show_online', 'pm_email_notify', 'pm_receive_from', 'karma_good', 'karma_bad',
-		'notify_announcements', 'notify_send_body', 'notify_regularity', 'notify_types',
+		'notify_announcements', 'notify_send_body', 'notify_regularity', 'notify_types', 'alerts',
 		'id_theme', 'is_activated', 'id_msg_last_visit', 'id_post_group', 'total_time_logged_in', 'warning',
 	);
 	$knownFloats = array(

+ 1 - 1
Sources/tasks/Register-Notify.php

@@ -81,7 +81,7 @@ class Register_Notify_Background extends SMF_BackgroundTask
 			);
 
 			// And update the count of alerts for those people.
-			updateMemberData($members, array('alerts' => '+'));
+			updateMemberData($notifies['alert'], array('alerts' => '+'));
 		}
 
 		// Secondly, anyone who wants emails.