From: Douglas Gardner Date: Mon, 20 Jan 2014 05:55:06 +0000 (+0000) Subject: Remove `login-throttled` system message reuse X-Git-Tag: 1.31.0-rc.0~17188^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=1d25d8bd60e765d9bf7b8eb43c792e3d1a19a2bf;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index d9ef5d7aa2..e678259100 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -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; } diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index d54828a1bf..484e00c7d0 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -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() ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 726b8f053c..4d126836b9 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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' => '', # 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', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 5ab76d2f42..8166aeb087 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 8b76a6b7a9..d51cdd0f69 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -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',