* (bug 22606) The body of e-mail address confirmation message is now different when...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 27 Feb 2010 20:22:56 +0000 (20:22 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 27 Feb 2010 20:22:56 +0000 (20:22 +0000)
RELEASE-NOTES
includes/Preferences.php
includes/User.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 1d79a61..2238e7b 100644 (file)
@@ -27,6 +27,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   throws an error
 * (bugs 22665 and 22667) User '0' can now be unblocked and have its block
   settings changed
+* (bug 22606) The body of e-mail address confirmation message is now different
+  when the address changed
 
 == API changes in 1.17 ==
 
index 70d88ec..daf9309 100644 (file)
@@ -1272,7 +1272,7 @@ class Preferences {
                                if( $wgEmailAuthentication ) {
                                        # Mail a temporary password to the dirty address.
                                        # User can come back through the confirmation URL to re-enable email.
-                                       $result = $wgUser->sendConfirmationMail();
+                                       $result = $wgUser->sendConfirmationMail( $oldadr != '' );
                                        if( WikiError::isError( $result ) ) {
                                                return wfMsg( 'mailerror', htmlspecialchars( $result->getMessage() ) );
                                        } elseif( $entryPoint == 'ui' ) {
index f09294f..475f976 100644 (file)
@@ -2908,9 +2908,10 @@ class User {
         * Generate a new e-mail confirmation token and send a confirmation/invalidation
         * mail to the user's given address.
         *
+        * @param $changed Boolean: whether the adress changed
         * @return \types{\bool,\type{WikiError}} True on success, a WikiError object on failure.
         */
-       function sendConfirmationMail() {
+       function sendConfirmationMail( $changed = false ) {
                global $wgLang;
                $expiration = null; // gets passed-by-ref and defined in next line.
                $token = $this->confirmationToken( $expiration );
@@ -2918,8 +2919,9 @@ class User {
                $invalidateURL = $this->invalidationTokenUrl( $token );
                $this->saveSettings();
 
+               $message = $changed ? 'confirmemail_body_changed' : 'confirmemail_body';
                return $this->sendMail( wfMsg( 'confirmemail_subject' ),
-                       wfMsg( 'confirmemail_body',
+                       wfMsg( $message,
                                wfGetIP(),
                                $this->getName(),
                                $url,
index 9d55089..d77c574 100644 (file)
@@ -3866,31 +3866,31 @@ Others will be hidden by default.
 'limitall'         => 'all',
 
 # E-mail address confirmation
-'confirmemail'             => 'Confirm e-mail address',
-'confirmemail_noemail'     => 'You do not have a valid e-mail address set in your [[Special:Preferences|user preferences]].',
-'confirmemail_text'        => '{{SITENAME}} requires that you validate your e-mail address before using e-mail features.
+'confirmemail'              => 'Confirm e-mail address',
+'confirmemail_noemail'      => 'You do not have a valid e-mail address set in your [[Special:Preferences|user preferences]].',
+'confirmemail_text'         => '{{SITENAME}} requires that you validate your e-mail address before using e-mail features.
 Activate the button below to send a confirmation mail to your address.
 The mail will include a link containing a code;
 load the link in your browser to confirm that your e-mail address is valid.',
-'confirmemail_pending'     => 'A confirmation code has already been e-mailed to you;
+'confirmemail_pending'      => 'A confirmation code has already been e-mailed to you;
 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.',
-'confirmemail_send'        => 'Mail a confirmation code',
-'confirmemail_sent'        => 'Confirmation e-mail sent.',
-'confirmemail_oncreate'    => 'A confirmation code was sent to your e-mail address.
+'confirmemail_send'         => 'Mail a confirmation code',
+'confirmemail_sent'         => 'Confirmation e-mail sent.',
+'confirmemail_oncreate'     => 'A confirmation code was sent to your e-mail address.
 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.',
-'confirmemail_sendfailed'  => '{{SITENAME}} could not send your confirmation mail.
+'confirmemail_sendfailed'   => '{{SITENAME}} could not send your confirmation mail.
 Please check your e-mail address for invalid characters.
 
 Mailer returned: $1',
-'confirmemail_invalid'     => 'Invalid confirmation code.
+'confirmemail_invalid'      => 'Invalid confirmation code.
 The code may have expired.',
-'confirmemail_needlogin'   => 'You need to $1 to confirm your e-mail address.',
-'confirmemail_success'     => 'Your e-mail address has been confirmed.
+'confirmemail_needlogin'    => 'You need to $1 to confirm your e-mail address.',
+'confirmemail_success'      => 'Your e-mail address has been confirmed.
 You may now [[Special:UserLogin|log in]] and enjoy the wiki.',
-'confirmemail_loggedin'    => 'Your e-mail address has now been confirmed.',
-'confirmemail_error'       => 'Something went wrong saving your confirmation.',
-'confirmemail_subject'     => '{{SITENAME}} e-mail address confirmation',
-'confirmemail_body'        => 'Someone, probably you, from IP address $1,
+'confirmemail_loggedin'     => 'Your e-mail address has now been confirmed.',
+'confirmemail_error'        => 'Something went wrong saving your confirmation.',
+'confirmemail_subject'      => '{{SITENAME}} e-mail address confirmation',
+'confirmemail_body'         => 'Someone, probably you, from IP address $1,
 has registered an account "$2" with this e-mail address on {{SITENAME}}.
 
 To confirm that this account really does belong to you and activate
@@ -3904,8 +3904,22 @@ to cancel the e-mail address confirmation:
 $5
 
 This confirmation code will expire at $4.',
-'confirmemail_invalidated' => 'E-mail address confirmation canceled',
-'invalidateemail'          => 'Cancel e-mail confirmation',
+'confirmemail_body_changed' => 'Someone, probably you, from IP address $1,
+has changed the e-mail address of the account "$2" to this address on {{SITENAME}}.
+
+To confirm that this account really does belong to you and reactivate
+e-mail features on {{SITENAME}}, open this link in your browser:
+
+$3
+
+If the account does *not* belong to you, follow this link
+to cancel the e-mail address confirmation:
+
+$5
+
+This confirmation code will expire at $4.',
+'confirmemail_invalidated'  => 'E-mail address confirmation canceled',
+'invalidateemail'           => 'Cancel e-mail confirmation',
 
 # Scary transclusion
 'scarytranscludedisabled' => '[Interwiki transcluding is disabled]',
index 0e39a51..f17953d 100644 (file)
@@ -2858,6 +2858,7 @@ $wgMessageStructure = array(
                'confirmemail_error',
                'confirmemail_subject',
                'confirmemail_body',
+               'confirmemail_body_changed',
                'confirmemail_invalidated',
                'invalidateemail',
        ),