Fix for r86482: throttle password attempts for SpecialChangePassword (uses r92884...
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 22 Jul 2011 21:06:39 +0000 (21:06 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 22 Jul 2011 21:06:39 +0000 (21:06 +0000)
includes/specials/SpecialChangePassword.php

index 3004b12..3abfa02 100644 (file)
@@ -215,6 +215,11 @@ class SpecialChangePassword extends SpecialPage {
                        throw new PasswordError( wfMsg( 'badretype' ) );
                }
 
+               $throttleCount = LoginForm::incLoginThrottle( $this->mUserName );
+               if ( $throttleCount === true ) {
+                       throw new PasswordError( wfMsg( 'login-throttled' ) );
+               }
+
                if( !$user->checkTemporaryPassword($this->mOldpass) && !$user->checkPassword($this->mOldpass) ) {
                        wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'wrongpassword' ) );
                        throw new PasswordError( wfMsg( 'resetpass-wrong-oldpass' ) );