MediaWiki r21468 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r21467‎ | r21468 (on ViewVC)‎ | r21469 >
Date:14:07, 22 April 2007
Author:tstarling
Status:old
Tags:
Comment:
Added $wgUsersNotifedOnAllChanges, array of usernames who will be sent a notification email for every change which occurs on a wiki
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
===================================================================
--- trunk/phase3/includes/UserMailer.php	(revision 21467)
+++ trunk/phase3/includes/UserMailer.php	(revision 21468)
@@ -229,6 +229,13 @@
 		$enotifusertalkpage = ($isUserTalkPage && $wgEnotifUserTalk);
 		$enotifwatchlistpage = $wgEnotifWatchlist;
 
+		$this->title =& $title;
+		$this->timestamp = $timestamp;
+		$this->summary = $summary;
+		$this->minorEdit = $minorEdit;
+		$this->oldid = $oldid;
+		$this->composeCommonMailtext();
+
 		if ( (!$minorEdit || $wgEnotifMinorEdits) ) {
 			if( $wgEnotifWatchlist ) {
 				// Send updates to watchers other than the current editor
@@ -263,13 +270,7 @@
 				# if anyone is watching ... set up the email message text which is
 				# common for all receipients ...
 				if ( $dbr->numRows( $res ) > 0 ) {
-					$this->title =& $title;
-					$this->timestamp = $timestamp;
-					$this->summary = $summary;
-					$this->minorEdit = $minorEdit;
-					$this->oldid = $oldid;
 
-					$this->composeCommonMailtext();
 					$watchingUser = new User();
 
 					# ... now do for all watching users ... if the options fit
@@ -294,6 +295,12 @@
 			} # if anyone is watching
 		} # if $wgEnotifWatchlist = true
 
+		global $wgUsersNotifedOnAllChanges;
+		foreach ( $wgUsersNotifedOnAllChanges as $name ) {
+			$user = User::newFromName( $name );
+			$this->composeAndSendPersonalisedMail( $user );
+		}
+
 		if ( $wgShowUpdatedMarker || $wgEnotifWatchlist ) {
 			# mark the changed watch-listed page with a timestamp, so that the page is
 			# listed with an "updated since your last visit" icon in the watch list, ...
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 21467)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 21468)
@@ -1172,6 +1172,10 @@
 $wgEnotifRevealEditorAddress	= false;	# UPO; reply-to address may be filled with page editor's address (if user allowed this in the preferences)
 $wgEnotifMinorEdits		= true;	# UPO; false: "minor edits" on pages do not trigger notification mails.
 #							# Attention: _every_ change on a user_talk page trigger a notification mail (if the user is not yet notified)
+
+/** 
+ * Array of usernames who will be sent a notification email for every change which occurs on a wiki
+ */
 $wgUsersNotifedOnAllChanges = array();
 
 /** Show watching users in recent changes, watchlist and page history views */
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox