* (bug 22606) Follow-up r63059: don't send the "someone registred an account" message...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 29 Jan 2011 09:32:02 +0000 (09:32 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 29 Jan 2011 09:32:02 +0000 (09:32 +0000)
includes/Preferences.php
includes/User.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 77f9d3d..57dab31 100644 (file)
@@ -1288,7 +1288,8 @@ 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( $oldaddr != '' );
+                                       $type = $oldaddr != '' ? 'changed' : 'set';
+                                       $result = $wgUser->sendConfirmationMail( $type );
                                        if ( !$result->isGood() ) {
                                                return htmlspecialchars( $result->getWikiText( 'mailerror' ) );
                                        } elseif ( $entryPoint == 'ui' ) {
index 2ef85d2..e336ea0 100644 (file)
@@ -2917,10 +2917,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
+        * @param $type String: message to send, either "created", "changed" or "set"
         * @return Status object
         */
-       function sendConfirmationMail( $changed = false ) {
+       function sendConfirmationMail( $type = 'created' ) {
                global $wgLang;
                $expiration = null; // gets passed-by-ref and defined in next line.
                $token = $this->confirmationToken( $expiration );
@@ -2928,7 +2928,14 @@ class User {
                $invalidateURL = $this->invalidationTokenUrl( $token );
                $this->saveSettings();
 
-               $message = $changed ? 'confirmemail_body_changed' : 'confirmemail_body';
+               if ( $type == 'created' || $type === false ) {
+                       $message = 'confirmemail_body';
+               } elseif ( $type === true ) {
+                       $message = 'confirmemail_body_changed';
+               } else {
+                       $message = 'confirmemail_body_' . $type;
+               }
+
                return $this->sendMail( wfMsg( 'confirmemail_subject' ),
                        wfMsg( $message,
                                wfGetIP(),
index b9a5bde..4aadb9d 100644 (file)
@@ -4057,6 +4057,20 @@ to cancel the e-mail address confirmation:
 
 $5
 
+This confirmation code will expire at $4.',
+'confirmemail_body_set'     => 'Someone, probably you, from IP address $1,
+has set 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',
index 7a8b7ff..66bcdad 100644 (file)
@@ -2990,6 +2990,7 @@ $wgMessageStructure = array(
                'confirmemail_subject',
                'confirmemail_body',
                'confirmemail_body_changed',
+               'confirmemail_body_set',
                'confirmemail_invalidated',
                'invalidateemail',
        ),