http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76234
Revision: 76234
Author: ialex
Date: 2010-11-07 09:30:42 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
* (bug 25728) Added $wgPasswordSenderName to allow customise the name associed
with $wgPasswordSender
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/includes/User.php
trunk/phase3/includes/UserMailer.php
trunk/phase3/includes/specials/SpecialEmailuser.php
Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES 2010-11-07 07:41:55 UTC (rev 76233)
+++ trunk/phase3/RELEASE-NOTES 2010-11-07 09:30:42 UTC (rev 76234)
@@ -86,6 +86,8 @@
* The FailFunction "error handling" method has now been removed
* $wgAdditionalMailParams added to allow setting extra options to mail() calls.
* $wgSecureLogin & $wgSecureLoginStickHTTPS to optionaly login using HTTPS
+* (bug 25728) Added $wgPasswordSenderName to allow customise the name associed
+ with $wgPasswordSender
=== New features in 1.17 ===
* (bug 10183) Users can now add personal styles and scripts to all skins via
Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php 2010-11-07 07:41:55 UTC (rev
76233)
+++ trunk/phase3/includes/DefaultSettings.php 2010-11-07 09:30:42 UTC (rev
76234)
@@ -968,16 +968,21 @@
*
* The address we should use as sender when a user is requesting his password.
*/
-$wgPasswordSender = 'MediaWiki Mail <apache@' . $serverName . '>';
+$wgPasswordSender = 'apache@' . $serverName;
-unset($serverName); # Don't leak local variables to global scope
+unset( $serverName ); # Don't leak local variables to global scope
/**
+ * Password reminder name
+ */
+$wgPasswordSenderName = 'MediaWiki Mail';
+
+/**
* Dummy address which should be accepted during mail send action.
* It might be necessary to adapt the address or to set it equal
* to the $wgEmergencyContact address.
*/
-$wgNoReplyAddress = '[email protected]';
+$wgNoReplyAddress = '[email protected]';
/**
* Set to true to enable the e-mail basic features:
@@ -1000,7 +1005,7 @@
* which can cause problems with SPF validation and leak recipient addressses
* when bounces are sent to the sender.
*/
-$wgUserEmailUseReplyTo = false;
+$wgUserEmailUseReplyTo = true;
/**
* Minimum time, in hours, which must elapse between password reminder
@@ -1033,9 +1038,6 @@
*/
$wgAdditionalMailParams = null;
-/** For email notification on page changes */
-$wgPasswordSender = $wgEmergencyContact;
-
/**
* True: from page editor if s/he opted-in. False: Enotif mails appear to come
* from $wgEmergencyContact
Modified: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php 2010-11-07 07:41:55 UTC (rev 76233)
+++ trunk/phase3/includes/User.php 2010-11-07 09:30:42 UTC (rev 76234)
@@ -2957,12 +2957,13 @@
*/
function sendMail( $subject, $body, $from = null, $replyto = null ) {
if( is_null( $from ) ) {
- global $wgPasswordSender;
- $from = $wgPasswordSender;
+ global $wgPasswordSender, $wgPasswordSenderName;
+ $sender = new MailAddress( $wgPasswordSender,
$wgPasswordSenderName );
+ } else {
+ $sender = new MailAddress( $from );
}
$to = new MailAddress( $this );
- $sender = new MailAddress( $from );
return UserMailer::send( $to, $sender, $subject, $body,
$replyto );
}
Modified: trunk/phase3/includes/UserMailer.php
===================================================================
--- trunk/phase3/includes/UserMailer.php 2010-11-07 07:41:55 UTC (rev
76233)
+++ trunk/phase3/includes/UserMailer.php 2010-11-07 09:30:42 UTC (rev
76234)
@@ -440,7 +440,7 @@
* @private
*/
function composeCommonMailtext() {
- global $wgPasswordSender, $wgNoReplyAddress;
+ global $wgPasswordSender, $wgPasswordSenderName,
$wgNoReplyAddress;
global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
global $wgEnotifImpersonal, $wgEnotifUseRealName;
@@ -496,7 +496,7 @@
# global configuration level.
$editor = $this->editor;
$name = $wgEnotifUseRealName ? $editor->getRealName() :
$editor->getName();
- $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin'
);
+ $adminAddress = new MailAddress( $wgPasswordSender,
$wgPasswordSenderName );
$editorAddress = new MailAddress( $editor );
if( $wgEnotifRevealEditorAddress
&& ( $editor->getEmail() != '' )
Modified: trunk/phase3/includes/specials/SpecialEmailuser.php
===================================================================
--- trunk/phase3/includes/specials/SpecialEmailuser.php 2010-11-07 07:41:55 UTC
(rev 76233)
+++ trunk/phase3/includes/specials/SpecialEmailuser.php 2010-11-07 09:30:42 UTC
(rev 76234)
@@ -256,8 +256,8 @@
// This is a bit ugly, but will serve to differentiate
// wiki-borne mails from direct mails and protects
against
// SPF and bounce problems with some mailers (see
below).
- global $wgPasswordSender;
- $mailFrom = new MailAddress( $wgPasswordSender );
+ global $wgPasswordSender, $wgPasswordSenderName;
+ $mailFrom = new MailAddress( $wgPasswordSender,
$wgPasswordSenderName );
$replyTo = $from;
} else {
// Put the sending user's e-mail address in the From:
header.
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs