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 );
$dbw->update(
'user',
[ 'user_password_expires' => $dbw->timestampOrNull( $newExpire ) ],
- [ 'user_id' => $user->getID() ],
+ [ 'user_id' => $user->getId() ],
__METHOD__
);
}