From: Aaron Schulz Date: Mon, 12 Mar 2007 21:56:31 +0000 (+0000) Subject: *Get range blocks to consider "anononly" while I'm at it X-Git-Tag: 1.31.0-rc.0~53787 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=28772d7e2d306b97a654873bb8a0f989663f886a;p=lhc%2Fweb%2Fwiklou.git *Get range blocks to consider "anononly" while I'm at it --- diff --git a/includes/Block.php b/includes/Block.php index e35ead82d1..89764ce472 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -147,7 +147,7 @@ class Block } # Try range block - if ( $this->loadRange( $address, $killExpired, $user == 0 ) ) { + if ( $this->loadRange( $address, $killExpired, $user ) ) { if ( $user && $this->mAnonOnly ) { $this->clear(); return false; @@ -212,7 +212,7 @@ class Block * Search the database for any range blocks matching the given address, and * load the row if one is found. */ - function loadRange( $address, $killExpired = true ) + function loadRange( $address, $killExpired = true, $user = 0 ) { $iaddr = IP::toHex( $address ); if ( $iaddr === false ) { @@ -231,6 +231,10 @@ class Block "ipb_range_start <= '$iaddr'", "ipb_range_end >= '$iaddr'" ); + + if ( $user ) { + $conds['ipb_anon_only'] = 0; + } $res = $db->resultObject( $db->select( 'ipblocks', '*', $conds, __METHOD__, $options ) ); $success = $this->loadFromResult( $res, $killExpired );