- $throttleCount = LoginForm::incLoginThrottle( $user->getName() );
- if ( $throttleCount === true ) {
- $lang = $this->getLanguage();
- $throttleInfo = $this->getConfig()->get( 'PasswordAttemptThrottle' );
- return Status::newFatal(
- 'changeemail-throttled',
- $lang->formatDuration( $throttleInfo['seconds'] )
- );
- }
-
- if ( $this->getConfig()->get( 'RequirePasswordforEmailChange' )
- && !$user->checkTemporaryPassword( $pass )
- && !$user->checkPassword( $pass )
- ) {
- return Status::newFatal( 'wrongpassword' );
- }
-
- if ( $throttleCount ) {
- LoginForm::clearLoginThrottle( $user->getName() );
- }
-