return Status::newFatal( $this->msg( 'badretype' ) );
}
- $throttleCount = LoginForm::incLoginThrottle( $this->mUserName );
- if ( $throttleCount === true ) {
- $lang = $this->getLanguage();
- $throttleInfo = $this->getConfig()->get( 'PasswordAttemptThrottle' );
+ $throttleInfo = LoginForm::incrementLoginThrottle( $this->mUserName );
+ if ( $throttleInfo ) {
return Status::newFatal( $this->msg( 'changepassword-throttled' )
- ->params( $lang->formatDuration( $throttleInfo['seconds'] ) )
+ ->durationParams( $throttleInfo['wait'] )
);
}
}
// Please reset throttle for successful logins, thanks!
- if ( $throttleCount ) {
- LoginForm::clearLoginThrottle( $this->mUserName );
- }
+ LoginForm::clearLoginThrottle( $this->mUserName );
try {
$user->setPassword( $newpass );