r76234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76233‎ | r76234 | r76235 >
Date:09:30, 7 November 2010
Author:ialex
Status:ok (Comments)
Tags:
Comment:
* (bug 25728) Added $wgPasswordSenderName to allow customise the name associed with $wgPasswordSender
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2957,12 +2957,13 @@
29582958 */
29592959 function sendMail( $subject, $body, $from = null, $replyto = null ) {
29602960 if( is_null( $from ) ) {
2961 - global $wgPasswordSender;
2962 - $from = $wgPasswordSender;
 2961+ global $wgPasswordSender, $wgPasswordSenderName;
 2962+ $sender = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
 2963+ } else {
 2964+ $sender = new MailAddress( $from );
29632965 }
29642966
29652967 $to = new MailAddress( $this );
2966 - $sender = new MailAddress( $from );
29672968 return UserMailer::send( $to, $sender, $subject, $body, $replyto );
29682969 }
29692970
Index: trunk/phase3/includes/UserMailer.php
@@ -440,7 +440,7 @@
441441 * @private
442442 */
443443 function composeCommonMailtext() {
444 - global $wgPasswordSender, $wgNoReplyAddress;
 444+ global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress;
445445 global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
446446 global $wgEnotifImpersonal, $wgEnotifUseRealName;
447447
@@ -496,7 +496,7 @@
497497 # global configuration level.
498498 $editor = $this->editor;
499499 $name = $wgEnotifUseRealName ? $editor->getRealName() : $editor->getName();
500 - $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
 500+ $adminAddress = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
501501 $editorAddress = new MailAddress( $editor );
502502 if( $wgEnotifRevealEditorAddress
503503 && ( $editor->getEmail() != '' )
Index: trunk/phase3/includes/DefaultSettings.php
@@ -968,16 +968,21 @@
969969 *
970970 * The address we should use as sender when a user is requesting his password.
971971 */
972 -$wgPasswordSender = 'MediaWiki Mail <apache@' . $serverName . '>';
 972+$wgPasswordSender = 'apache@' . $serverName;
973973
974 -unset($serverName); # Don't leak local variables to global scope
 974+unset( $serverName ); # Don't leak local variables to global scope
975975
976976 /**
 977+ * Password reminder name
 978+ */
 979+$wgPasswordSenderName = 'MediaWiki Mail';
 980+
 981+/**
977982 * Dummy address which should be accepted during mail send action.
978983 * It might be necessary to adapt the address or to set it equal
979984 * to the $wgEmergencyContact address.
980985 */
981 -$wgNoReplyAddress = 'reply@not.possible';
 986+$wgNoReplyAddress = 'reply@not.possible';
982987
983988 /**
984989 * Set to true to enable the e-mail basic features:
@@ -1000,7 +1005,7 @@
10011006 * which can cause problems with SPF validation and leak recipient addressses
10021007 * when bounces are sent to the sender.
10031008 */
1004 -$wgUserEmailUseReplyTo = false;
 1009+$wgUserEmailUseReplyTo = true;
10051010
10061011 /**
10071012 * Minimum time, in hours, which must elapse between password reminder
@@ -1033,9 +1038,6 @@
10341039 */
10351040 $wgAdditionalMailParams = null;
10361041
1037 -/** For email notification on page changes */
1038 -$wgPasswordSender = $wgEmergencyContact;
1039 -
10401042 /**
10411043 * True: from page editor if s/he opted-in. False: Enotif mails appear to come
10421044 * from $wgEmergencyContact
Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -256,8 +256,8 @@
257257 // This is a bit ugly, but will serve to differentiate
258258 // wiki-borne mails from direct mails and protects against
259259 // SPF and bounce problems with some mailers (see below).
260 - global $wgPasswordSender;
261 - $mailFrom = new MailAddress( $wgPasswordSender );
 260+ global $wgPasswordSender, $wgPasswordSenderName;
 261+ $mailFrom = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
262262 $replyTo = $from;
263263 } else {
264264 // Put the sending user's e-mail address in the From: header.
Index: trunk/phase3/RELEASE-NOTES
@@ -86,6 +86,8 @@
8787 * The FailFunction "error handling" method has now been removed
8888 * $wgAdditionalMailParams added to allow setting extra options to mail() calls.
8989 * $wgSecureLogin & $wgSecureLoginStickHTTPS to optionaly login using HTTPS
 90+* (bug 25728) Added $wgPasswordSenderName to allow customise the name associed
 91+ with $wgPasswordSender
9092
9193 === New features in 1.17 ===
9294 * (bug 10183) Users can now add personal styles and scripts to all skins via

Follow-up revisions

RevisionCommit summaryAuthorDate
r76235Removed debugging code left in r76234ialex09:32, 7 November 2010

Comments

#Comment by Platonides (talk | contribs)   12:09, 7 November 2010

Having 'MediaWiki Mail' name in other cases wasn't a bad idea.

#Comment by IAlex (talk | contribs)   16:03, 7 November 2010

This was never 'MediaWiki Mail' since $wgPasswordSender was copied from $wgEmergencyContact (see the last set of changes in DefaultSettings.php).

#Comment by Platonides (talk | contribs)   18:05, 7 November 2010

O_O

$wgPasswordSender has been overwritten since r6696, when Brion merged enotif (the variable has existed since r1529).

Status & tagging log