Actually proper usage would probably be to split the messages.
Followup to Id385be840f340476fbe7a818ff1d05154fe86d68;
spotted by Shirayuki.
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Login-throttled/en
Change-Id: I565971a90fc383327a51d717a80013cb7a3e9c9b
* @return bool|string true or string on success, false on failure
*/
protected function attemptChange( User $user, $pass, $newaddr ) {
- global $wgAuth;
+ global $wgAuth, $wgPasswordAttemptThrottle;
if ( $newaddr != '' && !Sanitizer::validateEmail( $newaddr ) ) {
$this->error( 'invalidemailaddress' );
$throttleCount = LoginForm::incLoginThrottle( $user->getName() );
if ( $throttleCount === true ) {
- $this->error( 'login-throttled' );
+ $lang = $this->getLanguage();
+ $this->error( array( 'login-throttled', $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
return false;
}
* @throws PasswordError when cannot set the new password because requirements not met.
*/
protected function attemptReset( $newpass, $retype ) {
+ global $wgPasswordAttemptThrottle;
+
$isSelf = ( $this->mUserName === $this->getUser()->getName() );
if ( $isSelf ) {
$user = $this->getUser();
$throttleCount = LoginForm::incLoginThrottle( $this->mUserName );
if ( $throttleCount === true ) {
- throw new PasswordError( $this->msg( 'login-throttled' )->text() );
+ $lang = $this->getLanguage();
+ throw new PasswordError( $this->msg( 'login-throttled' )
+ ->params( $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) )
+ ->text()
+ );
}
$abortMsg = 'resetpass-abort-generic';
* $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' => '{{doc-important|<code>$1</code> is empty, which is used in [[Special:ChangeEmail]] and [[Special:ChangePassword]].}}
-Used as error message in [[Special:ChangeEmail]], [[Special:ChangePassword]], and [[Special:UserLogin]].
+'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]].
-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.
Parameters: