r63059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63058‎ | r63059 | r63060 >
Date:20:22, 27 February 2010
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
* (bug 22606) The body of e-mail address confirmation message is now different when the address changed
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /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
@@ -2858,6 +2858,7 @@
28592859 'confirmemail_error',
28602860 'confirmemail_subject',
28612861 'confirmemail_body',
 2862+ 'confirmemail_body_changed',
28622863 'confirmemail_invalidated',
28632864 'invalidateemail',
28642865 ),
Index: trunk/phase3/includes/User.php
@@ -2908,9 +2908,10 @@
29092909 * Generate a new e-mail confirmation token and send a confirmation/invalidation
29102910 * mail to the user's given address.
29112911 *
 2912+ * @param $changed Boolean: whether the adress changed
29122913 * @return \types{\bool,\type{WikiError}} True on success, a WikiError object on failure.
29132914 */
2914 - function sendConfirmationMail() {
 2915+ function sendConfirmationMail( $changed = false ) {
29152916 global $wgLang;
29162917 $expiration = null; // gets passed-by-ref and defined in next line.
29172918 $token = $this->confirmationToken( $expiration );
@@ -2918,8 +2919,9 @@
29192920 $invalidateURL = $this->invalidationTokenUrl( $token );
29202921 $this->saveSettings();
29212922
 2923+ $message = $changed ? 'confirmemail_body_changed' : 'confirmemail_body';
29222924 return $this->sendMail( wfMsg( 'confirmemail_subject' ),
2923 - wfMsg( 'confirmemail_body',
 2925+ wfMsg( $message,
29242926 wfGetIP(),
29252927 $this->getName(),
29262928 $url,
Index: trunk/phase3/includes/Preferences.php
@@ -1272,7 +1272,7 @@
12731273 if( $wgEmailAuthentication ) {
12741274 # Mail a temporary password to the dirty address.
12751275 # User can come back through the confirmation URL to re-enable email.
1276 - $result = $wgUser->sendConfirmationMail();
 1276+ $result = $wgUser->sendConfirmationMail( $oldadr != '' );
12771277 if( WikiError::isError( $result ) ) {
12781278 return wfMsg( 'mailerror', htmlspecialchars( $result->getMessage() ) );
12791279 } elseif( $entryPoint == 'ui' ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3866,31 +3866,31 @@
38673867 'limitall' => 'all',
38683868
38693869 # E-mail address confirmation
3870 -'confirmemail' => 'Confirm e-mail address',
3871 -'confirmemail_noemail' => 'You do not have a valid e-mail address set in your [[Special:Preferences|user preferences]].',
3872 -'confirmemail_text' => '{{SITENAME}} requires that you validate your e-mail address before using e-mail features.
 3870+'confirmemail' => 'Confirm e-mail address',
 3871+'confirmemail_noemail' => 'You do not have a valid e-mail address set in your [[Special:Preferences|user preferences]].',
 3872+'confirmemail_text' => '{{SITENAME}} requires that you validate your e-mail address before using e-mail features.
38733873 Activate the button below to send a confirmation mail to your address.
38743874 The mail will include a link containing a code;
38753875 load the link in your browser to confirm that your e-mail address is valid.',
3876 -'confirmemail_pending' => 'A confirmation code has already been e-mailed to you;
 3876+'confirmemail_pending' => 'A confirmation code has already been e-mailed to you;
38773877 if you recently created your account, you may wish to wait a few minutes for it to arrive before trying to request a new code.',
3878 -'confirmemail_send' => 'Mail a confirmation code',
3879 -'confirmemail_sent' => 'Confirmation e-mail sent.',
3880 -'confirmemail_oncreate' => 'A confirmation code was sent to your e-mail address.
 3878+'confirmemail_send' => 'Mail a confirmation code',
 3879+'confirmemail_sent' => 'Confirmation e-mail sent.',
 3880+'confirmemail_oncreate' => 'A confirmation code was sent to your e-mail address.
38813881 This code is not required to log in, but you will need to provide it before enabling any e-mail-based features in the wiki.',
3882 -'confirmemail_sendfailed' => '{{SITENAME}} could not send your confirmation mail.
 3882+'confirmemail_sendfailed' => '{{SITENAME}} could not send your confirmation mail.
38833883 Please check your e-mail address for invalid characters.
38843884
38853885 Mailer returned: $1',
3886 -'confirmemail_invalid' => 'Invalid confirmation code.
 3886+'confirmemail_invalid' => 'Invalid confirmation code.
38873887 The code may have expired.',
3888 -'confirmemail_needlogin' => 'You need to $1 to confirm your e-mail address.',
3889 -'confirmemail_success' => 'Your e-mail address has been confirmed.
 3888+'confirmemail_needlogin' => 'You need to $1 to confirm your e-mail address.',
 3889+'confirmemail_success' => 'Your e-mail address has been confirmed.
38903890 You may now [[Special:UserLogin|log in]] and enjoy the wiki.',
3891 -'confirmemail_loggedin' => 'Your e-mail address has now been confirmed.',
3892 -'confirmemail_error' => 'Something went wrong saving your confirmation.',
3893 -'confirmemail_subject' => '{{SITENAME}} e-mail address confirmation',
3894 -'confirmemail_body' => 'Someone, probably you, from IP address $1,
 3891+'confirmemail_loggedin' => 'Your e-mail address has now been confirmed.',
 3892+'confirmemail_error' => 'Something went wrong saving your confirmation.',
 3893+'confirmemail_subject' => '{{SITENAME}} e-mail address confirmation',
 3894+'confirmemail_body' => 'Someone, probably you, from IP address $1,
38953895 has registered an account "$2" with this e-mail address on {{SITENAME}}.
38963896
38973897 To confirm that this account really does belong to you and activate
@@ -3904,9 +3904,23 @@
39053905 $5
39063906
39073907 This confirmation code will expire at $4.',
3908 -'confirmemail_invalidated' => 'E-mail address confirmation canceled',
3909 -'invalidateemail' => 'Cancel e-mail confirmation',
 3908+'confirmemail_body_changed' => 'Someone, probably you, from IP address $1,
 3909+has changed the e-mail address of the account "$2" to this address on {{SITENAME}}.
39103910
 3911+To confirm that this account really does belong to you and reactivate
 3912+e-mail features on {{SITENAME}}, open this link in your browser:
 3913+
 3914+$3
 3915+
 3916+If the account does *not* belong to you, follow this link
 3917+to cancel the e-mail address confirmation:
 3918+
 3919+$5
 3920+
 3921+This confirmation code will expire at $4.',
 3922+'confirmemail_invalidated' => 'E-mail address confirmation canceled',
 3923+'invalidateemail' => 'Cancel e-mail confirmation',
 3924+
39113925 # Scary transclusion
39123926 'scarytranscludedisabled' => '[Interwiki transcluding is disabled]',
39133927 'scarytranscludefailed' => '[Template fetch failed for $1]',
Index: trunk/phase3/RELEASE-NOTES
@@ -27,6 +27,8 @@
2828 throws an error
2929 * (bugs 22665 and 22667) User '0' can now be unblocked and have its block
3030 settings changed
 31+* (bug 22606) The body of e-mail address confirmation message is now different
 32+ when the address changed
3133
3234 == API changes in 1.17 ==
3335

Follow-up revisions

RevisionCommit summaryAuthorDate
r81187* (bug 22606) Follow-up r63059: don't send the "someone registred an account"...ialex09:32, 29 January 2011

Comments

#Comment by Platonides (talk | contribs)   23:00, 27 February 2010

What about doing s/changed/emailchanged/ in the above modifications?

#Comment by Hashar (talk | contribs)   09:38, 7 November 2010

bug 22606 has follow up.

#Comment by IAlex (talk | contribs)   14:52, 29 January 2011

Fixed in r81187.

#Comment by Reedy (talk | contribs)   11:48, 1 February 2011

Minor typo - "adress"

#Comment by Reedy (talk | contribs)   11:49, 1 February 2011

Though, that's gone in the followup

Status & tagging log