Many more function case mismatches
[lhc/web/wiklou.git] / includes / specials / SpecialChangePassword.php
index 4f7ba25..5adc315 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 );
@@ -336,7 +332,7 @@ class SpecialChangePassword extends FormSpecialPage {
                $dbw->update(
                        'user',
                        [ 'user_password_expires' => $dbw->timestampOrNull( $newExpire ) ],
-                       [ 'user_id' => $user->getID() ],
+                       [ 'user_id' => $user->getId() ],
                        __METHOD__
                );
        }