r81187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81186‎ | r81187 | r81188 >
Date:09:32, 29 January 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
* (bug 22606) Follow-up r63059: don't send the "someone registred an account" message when setting email address (i.e. old one empty) in user preferences
Modified paths:
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2990,6 +2990,7 @@
29912991 'confirmemail_subject',
29922992 'confirmemail_body',
29932993 'confirmemail_body_changed',
 2994+ 'confirmemail_body_set',
29942995 'confirmemail_invalidated',
29952996 'invalidateemail',
29962997 ),
Index: trunk/phase3/includes/User.php
@@ -2917,10 +2917,10 @@
29182918 * Generate a new e-mail confirmation token and send a confirmation/invalidation
29192919 * mail to the user's given address.
29202920 *
2921 - * @param $changed Boolean: whether the adress changed
 2921+ * @param $type String: message to send, either "created", "changed" or "set"
29222922 * @return Status object
29232923 */
2924 - function sendConfirmationMail( $changed = false ) {
 2924+ function sendConfirmationMail( $type = 'created' ) {
29252925 global $wgLang;
29262926 $expiration = null; // gets passed-by-ref and defined in next line.
29272927 $token = $this->confirmationToken( $expiration );
@@ -2928,7 +2928,14 @@
29292929 $invalidateURL = $this->invalidationTokenUrl( $token );
29302930 $this->saveSettings();
29312931
2932 - $message = $changed ? 'confirmemail_body_changed' : 'confirmemail_body';
 2932+ if ( $type == 'created' || $type === false ) {
 2933+ $message = 'confirmemail_body';
 2934+ } elseif ( $type === true ) {
 2935+ $message = 'confirmemail_body_changed';
 2936+ } else {
 2937+ $message = 'confirmemail_body_' . $type;
 2938+ }
 2939+
29332940 return $this->sendMail( wfMsg( 'confirmemail_subject' ),
29342941 wfMsg( $message,
29352942 wfGetIP(),
Index: trunk/phase3/includes/Preferences.php
@@ -1288,7 +1288,8 @@
12891289 if ( $wgEmailAuthentication ) {
12901290 # Mail a temporary password to the dirty address.
12911291 # User can come back through the confirmation URL to re-enable email.
1292 - $result = $wgUser->sendConfirmationMail( $oldaddr != '' );
 1292+ $type = $oldaddr != '' ? 'changed' : 'set';
 1293+ $result = $wgUser->sendConfirmationMail( $type );
12931294 if ( !$result->isGood() ) {
12941295 return htmlspecialchars( $result->getWikiText( 'mailerror' ) );
12951296 } elseif ( $entryPoint == 'ui' ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -4058,6 +4058,20 @@
40594059 $5
40604060
40614061 This confirmation code will expire at $4.',
 4062+'confirmemail_body_set' => 'Someone, probably you, from IP address $1,
 4063+has set the e-mail address of the account "$2" to this address on {{SITENAME}}.
 4064+
 4065+To confirm that this account really does belong to you and reactivate
 4066+e-mail features on {{SITENAME}}, open this link in your browser:
 4067+
 4068+$3
 4069+
 4070+If the account does *not* belong to you, follow this link
 4071+to cancel the e-mail address confirmation:
 4072+
 4073+$5
 4074+
 4075+This confirmation code will expire at $4.',
40624076 'confirmemail_invalidated' => 'E-mail address confirmation canceled',
40634077 'invalidateemail' => 'Cancel e-mail confirmation',
40644078

Follow-up revisions

RevisionCommit summaryAuthorDate
r814111.17: MFT r81186, r81187, r81197, r81209, r81210, r81211, r81215, r81238, r81...catrope20:23, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63059* (bug 22606) The body of e-mail address confirmation message is now differen...ialex20:22, 27 February 2010

Comments

#Comment by Hashar (talk | contribs)   18:53, 1 February 2011

I have marked it for inclusion in 1.17 since the message was confusing. Thx Ialex for the patch!

Status & tagging log