From: Tim Starling Date: Sun, 22 Apr 2007 14:07:28 +0000 (+0000) Subject: Added $wgUsersNotifedOnAllChanges, array of usernames who will be sent a notification... X-Git-Tag: 1.31.0-rc.0~53287 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=644c2a89ff4320290fdbff4e7465c870e7d96990;p=lhc%2Fweb%2Fwiklou.git Added $wgUsersNotifedOnAllChanges, array of usernames who will be sent a notification email for every change which occurs on a wiki --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index cf5740978f..b80b201438 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 */ diff --git a/includes/UserMailer.php b/includes/UserMailer.php index a9669aa248..9f5f178c12 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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, ...