Remove `login-throttled` system message reuse
authorDouglas Gardner <douglas@chippy.ch>
Mon, 20 Jan 2014 05:55:06 +0000 (05:55 +0000)
committerDouglas Gardner <douglas@chippy.ch>
Mon, 20 Jan 2014 15:51:08 +0000 (15:51 +0000)
Replaced calls to the `login-throttled` system message to new, separate system
messages for [[Special:ChangeEmail]] and [[Special:ChangePassword]] in order to
minimise message reuse.

* [[Special:ChangeEmail]] now uses `changeemail-throttled` instead of
  `login-throttled`.
* [[Special:ChangePassword]] now uses `changepassword-throttled` instead of
  `login-throttled`.

Follow-up to I565971a90fc383327a51d717a80013cb7a3e9c9b.

Bug: 53655
Change-Id: Icc7ad829b381514627dca16cde62ccf0831967b6

includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index d9ef5d7..e678259 100644 (file)
@@ -232,7 +232,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                $throttleCount = LoginForm::incLoginThrottle( $user->getName() );
                if ( $throttleCount === true ) {
                        $lang = $this->getLanguage();
-                       $this->error( array( 'login-throttled', $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
+                       $this->error( array( 'changeemail-throttled', $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
 
                        return false;
                }
index d54828a..484e00c 100644 (file)
@@ -205,7 +205,7 @@ class SpecialChangePassword extends FormSpecialPage {
                $throttleCount = LoginForm::incLoginThrottle( $this->mUserName );
                if ( $throttleCount === true ) {
                        $lang = $this->getLanguage();
-                       throw new PasswordError( $this->msg( 'login-throttled' )
+                       throw new PasswordError( $this->msg( 'changepassword-throttled' )
                                ->params( $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) )
                                ->text()
                        );
index 726b8f0..4d12683 100644 (file)
@@ -1268,6 +1268,8 @@ If you choose to provide it, this will be used for giving the user attribution f
 # Change password dialog
 'changepassword'            => 'Change password',
 'changepassword-summary'    => '', # do not translate or duplicate this message to other languages
+'changepassword-throttled'  => 'You have made too many recent login attempts.
+Please wait $1 before trying again.',
 'resetpass_announce'        => 'You logged in with a temporary emailed code.
 To finish logging in, you must set a new password here:',
 'resetpass_text'            => '<!-- Add text here -->', # only translate this message to other languages if you have to change it
@@ -1338,6 +1340,8 @@ Temporary password: $2',
 'changeemail-password' => 'Your {{SITENAME}} password:',
 'changeemail-submit'   => 'Change email',
 'changeemail-cancel'   => 'Cancel',
+'changeemail-throttled' => 'You have made too many login attempts.
+Please wait $1 before trying again.',
 
 # Special:ResetTokens
 'resettokens'                 => 'Reset tokens',
index 5ab76d2..8166aeb 100644 (file)
@@ -1558,7 +1558,7 @@ Parameters:
 * $3 - a password (randomly generated)
 * $4 - a URL to the wiki ('<' + server name + script name + '>')
 * $5 - (Unused) number of days to password expiry date",
-'login-throttled' => 'Error message shown at [[Special:UserLogin]] after the user has tried to login with incorrect password too many times; also used by [[Special:ChangeEmail]] and [[Special:ChangePassword]].
+'login-throttled' => 'Error message shown at [[Special:UserLogin]] after the user has tried to login with incorrect password too many times.
 
 The user has to wait a certain time before trying to log in again.
 
@@ -1576,7 +1576,8 @@ Parameters:
 
 This is a protection against robots trying to find the password by trying lots of them.
 The number of attempts and waiting time are configured via [[mw:Manual:$wgPasswordAttemptThrottle|$wgPasswordAttemptThrottle]].
-This message is used in html.',
+This message is used in html.
+{{identical|Login throttled}}',
 'login-abort-generic' => 'The generic unsuccessful login message is used unless otherwise specified by hook writers',
 'loginlanguagelabel' => 'Used on [[Special:UserLogin]] if $wgLoginLanguageSelector is true. Parameters:
 * $1 - a pipe-separated list built from the names that appear in the message {{msg-mw|Loginlanguagelinks}}.
@@ -1617,7 +1618,26 @@ Parameters:
 'resetpass-wrong-oldpass' => 'Error message shown on [[Special:ChangePassword]] when the old password is not valid.',
 'resetpass-temp-password' => 'The label of the input box for the temporary password (received by email) on the form displayed after logging in with a temporary password.',
 'resetpass-abort-generic' => 'Generic error message shown on [[Special:ChangePassword]] when an extension aborts a password change from a hook.',
+'changepassword-throttled' => 'Error message shown at [[Special:ChangePassword]] after the user has tried to login with incorrect password too many times.
+
+The user has to wait a certain time before trying to log in again.
+
+Parameters:
+* $1 - the time to wait before the next login attempt. Automatically formatted using the following duration messages:
+** {{msg-mw|Duration-millennia}}
+** {{msg-mw|Duration-centuries}}
+** {{msg-mw|Duration-decades}}
+** {{msg-mw|Duration-years}}
+** {{msg-mw|Duration-weeks}}
+** {{msg-mw|Duration-days}}
+** {{msg-mw|Duration-hours}}
+** {{msg-mw|Duration-minutes}}
+** {{msg-mw|Duration-seconds}}
 
+This is a protection against robots trying to find the password by trying lots of them.
+The number of attempts and waiting time are configured via [[mw:Manual:$wgPasswordAttemptThrottle|$wgPasswordAttemptThrottle]].
+This message is used in html.
+{{identical|Login throttled}}',
 # Special:PasswordReset
 'passwordreset' => 'Title of [[Special:PasswordReset]].
 {{Identical|Reset password}}',
@@ -1693,7 +1713,26 @@ Parameters:
 'changeemail-cancel' => 'Cancel button on [[Special:ChangeEmail]]
 
 {{Identical|Cancel}}',
+'changeemail-throttled' => 'Error message shown at [[Special:ChangeEmail]] after the user has tried to login with incorrect password too many times.
 
+The user has to wait a certain time before trying to log in again.
+
+Parameters:
+* $1 - the time to wait before the next login attempt. Automatically formatted using the following duration messages:
+** {{msg-mw|Duration-millennia}}
+** {{msg-mw|Duration-centuries}}
+** {{msg-mw|Duration-decades}}
+** {{msg-mw|Duration-years}}
+** {{msg-mw|Duration-weeks}}
+** {{msg-mw|Duration-days}}
+** {{msg-mw|Duration-hours}}
+** {{msg-mw|Duration-minutes}}
+** {{msg-mw|Duration-seconds}}
+
+This is a protection against robots trying to find the password by trying lots of them.
+The number of attempts and waiting time are configured via [[mw:Manual:$wgPasswordAttemptThrottle|$wgPasswordAttemptThrottle]].
+This message is used in html.
+{{identical|Login throttled}}',
 # Special:ResetTokens
 'resettokens' => '{{doc-special|ResetTokens}}
 In this case "token" may be translated as "key", or similar.
index 8b76a6b..d51cdd0 100644 (file)
@@ -581,6 +581,7 @@ $wgMessageStructure = array(
                'retypenew',
                'resetpass_submit',
                'changepassword-success',
+               'changepassword-throttled',
                'resetpass_forbidden',
                'resetpass-no-info',
                'resetpass-submit-loggedin',
@@ -621,6 +622,7 @@ $wgMessageStructure = array(
                'changeemail-password',
                'changeemail-submit',
                'changeemail-cancel',
+               'changeemail-throttled'
        ),
        'resettokens' => array(
                'resettokens',