Don't apply IP blocks to users with "ipblock-exempt" rights when creating an account
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 12 Jan 2013 18:21:04 +0000 (19:21 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 12 Jan 2013 18:21:04 +0000 (19:21 +0100)
So that this check is consistent with the one in User::getBlockedStatus().

Change-Id: Ibcadb15b87794cfe59fc42d862728e5fd46c3413

includes/User.php

index ed3fe76..c71bec6 100644 (file)
@@ -3188,7 +3188,7 @@ class User {
                # bug 13611: if the IP address the user is trying to create an account from is
                # blocked with createaccount disabled, prevent new account creation there even
                # when the user is logged in
-               if( $this->mBlockedFromCreateAccount === false ){
+               if ( $this->mBlockedFromCreateAccount === false && !$this->isAllowed( 'ipblock-exempt' ) ) {
                        $this->mBlockedFromCreateAccount = Block::newFromTarget( null, $this->getRequest()->getIP() );
                }
                return $this->mBlockedFromCreateAccount instanceof Block && $this->mBlockedFromCreateAccount->prevents( 'createaccount' )