Added $wgUsersNotifedOnAllChanges, array of usernames who will be sent a notification...
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 22 Apr 2007 14:07:28 +0000 (14:07 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 22 Apr 2007 14:07:28 +0000 (14:07 +0000)
includes/DefaultSettings.php
includes/UserMailer.php

index cf57409..b80b201 100644 (file)
@@ -1172,6 +1172,10 @@ $wgEnotifUserTalk                = false;        # UPO
 $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 */
index a9669aa..9f5f178 100644 (file)
@@ -229,6 +229,13 @@ class EmailNotification {
                $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 @@ class EmailNotification {
                                # 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 @@ class EmailNotification {
                        } # 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, ...