Microchip08 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/108486


Change subject: Remove `login-throttled` system message reuse
......................................................................

Remove `login-throttled` system message reuse

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
---
M includes/specials/SpecialChangeEmail.php
M includes/specials/SpecialChangePassword.php
M languages/messages/MessagesEn.php
M languages/messages/MessagesQqq.php
4 files changed, 47 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/108486/1

diff --git a/includes/specials/SpecialChangeEmail.php 
b/includes/specials/SpecialChangeEmail.php
index d9ef5d7..e678259 100644
--- a/includes/specials/SpecialChangeEmail.php
+++ b/includes/specials/SpecialChangeEmail.php
@@ -232,7 +232,7 @@
                $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;
                }
diff --git a/includes/specials/SpecialChangePassword.php 
b/includes/specials/SpecialChangePassword.php
index d54828a..484e00c 100644
--- a/includes/specials/SpecialChangePassword.php
+++ b/includes/specials/SpecialChangePassword.php
@@ -205,7 +205,7 @@
                $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()
                        );
diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index 726b8f0..4d12683 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -1268,6 +1268,8 @@
 # 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 @@
 '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',
diff --git a/languages/messages/MessagesQqq.php 
b/languages/messages/MessagesQqq.php
index 5ab76d2..a97f84e 100644
--- a/languages/messages/MessagesQqq.php
+++ b/languages/messages/MessagesQqq.php
@@ -1558,7 +1558,7 @@
 * $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 @@
 
 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 @@
 '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 throttle}}',
 # Special:PasswordReset
 'passwordreset' => 'Title of [[Special:PasswordReset]].
 {{Identical|Reset password}}',
@@ -1693,7 +1713,26 @@
 '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 throttle}}',
 # Special:ResetTokens
 'resettokens' => '{{doc-special|ResetTokens}}
 In this case "token" may be translated as "key", or similar.

-- 
To view, visit https://gerrit.wikimedia.org/r/108486
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc7ad829b381514627dca16cde62ccf0831967b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Microchip08 <doug...@chippy.ch>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to