From: Andrew Garrett Date: Sun, 7 Jan 2007 06:21:54 +0000 (+0000) Subject: Fix for r18904 where autoblocker would not correctly block ipblock-exempt users. X-Git-Tag: 1.31.0-rc.0~54615 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=8c49f7ffd9c9f62896eef6c545c5ff6d41e2af83;p=lhc%2Fweb%2Fwiklou.git Fix for r18904 where autoblocker would not correctly block ipblock-exempt users. --- diff --git a/includes/User.php b/includes/User.php index 9bbe1afadb..079e103c4c 100644 --- a/includes/User.php +++ b/includes/User.php @@ -836,15 +836,15 @@ class User { $this->mBlockedby = 0; $ip = wfGetIP(); - if ($this->isAllowed( 'ipblock-exempt' ) ) { - # Exempt from all types of IP-block - $ip = null; + if (!$this->isAllowed( 'ipblock-exempt' ) ) { + # Check for IP blocks - ipblock-exempt is exempt from all types of IP block. + $check_ip = $ip; } # User/IP blocking $this->mBlock = new Block(); $this->mBlock->fromMaster( !$bFromSlave ); - if ( $this->mBlock->load( $ip , $this->mId ) ) { + if ( $this->mBlock->load( $check_ip , $this->mId ) ) { wfDebug( __METHOD__.": Found block.\n" ); $this->mBlockedby = $this->mBlock->mBy; $this->mBlockreason = $this->mBlock->mReason; @@ -860,14 +860,14 @@ class User { if ( !$this->isAllowed('proxyunbannable') && !in_array( $ip, $wgProxyWhitelist ) ) { # Local list - if ( wfIsLocallyBlockedProxy( $ip ) ) { + if ( wfIsLocallyBlockedProxy( $check_ip ) ) { $this->mBlockedby = wfMsg( 'proxyblocker' ); $this->mBlockreason = wfMsg( 'proxyblockreason' ); } # DNSBL if ( !$this->mBlockedby && $wgEnableSorbs && !$this->getID() ) { - if ( $this->inSorbsBlacklist( $ip ) ) { + if ( $this->inSorbsBlacklist( $check_ip ) ) { $this->mBlockedby = wfMsg( 'sorbs' ); $this->mBlockreason = wfMsg( 'sorbsreason' ); }