From: Andrew Garrett Date: Fri, 3 Nov 2006 13:24:53 +0000 (+0000) Subject: Various fixes related to the blocking change re: autoblocks. On inserting an IP block... X-Git-Tag: 1.31.0-rc.0~55294 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=65957ef12cde9fae3a1fd0c38f2a848456247e34;p=lhc%2Fweb%2Fwiklou.git Various fixes related to the blocking change re: autoblocks. On inserting an IP block, the ipb_enable_autoblock field is now automagically blanked, because it doesn't make any sense for an IP block. Additionally, IP blocks without the ipb_enable_autoblock option no longer show up as "autoblock disabled" on Special:Ipblocklist. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 48ea4a8c24..6ae9087181 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -132,6 +132,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 7785) Postgres compatibility for timestamps in RC feeds * (bug 7550) Normalize user parameter normally on Special:Log * (bug 7294) Fix PATH search for diff3 on install +* Various fixes related to the blocking change re: autoblocks. On inserting + an IP block, the ipb_enable_autoblock field is now automagically blanked, + because it doesn't make any sense for an IP. Additionally, IP blocks + without the ipb_enable_autoblock option no longer show up as "autoblock + disabled" on Special:Ipblocklist. == Languages updated == diff --git a/includes/Block.php b/includes/Block.php index 679ff1efe0..8a0f27ca46 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -367,6 +367,11 @@ class Block $this->mAnonOnly = 0; } + # Unset ipb_enable_autoblock for IP blocks, makes no sense + if ( !$this->mUser ) { + $this->mEnableAutoblock = 0; + } + # Don't collide with expired blocks Block::purgeExpired(); diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index c249e7fe7a..85764be909 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -277,7 +277,7 @@ class IPUnblockForm { if ( $block->mCreateAccount ) { $properties[] = $msg['createaccountblock']; } - if (!$block->mEnableAutoblock ) { + if (!$block->mEnableAutoblock && !$block->mAddress ) { $properties[] = $msg['noautoblockblock']; }