Add --with-phpunitclass arg to phpunit.php
[lhc/web/wiklou.git] / includes / specials / SpecialChangePassword.php
index 4f7ba25..2d0d020 100644 (file)
@@ -257,12 +257,10 @@ class SpecialChangePassword extends FormSpecialPage {
                        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'] )
                        );
                }
 
@@ -286,9 +284,7 @@ class SpecialChangePassword extends FormSpecialPage {
                }
 
                // Please reset throttle for successful logins, thanks!
-               if ( $throttleCount ) {
-                       LoginForm::clearLoginThrottle( $this->mUserName );
-               }
+               LoginForm::clearLoginThrottle( $this->mUserName );
 
                try {
                        $user->setPassword( $newpass );