From 5941189de0c2a55ba8964eaefbfc5f95fecdbaf8 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Wed, 1 Nov 2006 21:36:03 +0000 Subject: [PATCH] Revert patch that was scapped into production without database changes --- includes/Block.php | 10 +++------- includes/SpecialBlockip.php | 19 ++----------------- includes/User.php | 4 ---- languages/messages/MessagesEn.php | 1 - .../archives/patch-ipb_optional_autoblock.sql | 3 --- maintenance/mysql5/tables.sql | 3 --- maintenance/tables.sql | 3 --- maintenance/updaters.inc | 2 -- 8 files changed, 5 insertions(+), 40 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index 679ff1efe0..b11df22c9f 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -17,7 +17,7 @@ class Block { /* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry, - $mRangeStart, $mRangeEnd, $mAnonOnly, $mEnableAutoblock; + $mRangeStart, $mRangeEnd, $mAnonOnly; /* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster, $mByName; const EB_KEEP_EXPIRED = 1; @@ -25,7 +25,7 @@ class Block const EB_RANGE_ONLY = 4; function Block( $address = '', $user = 0, $by = 0, $reason = '', - $timestamp = '' , $auto = 0, $expiry = '', $anonOnly = 0, $createAccount = 0, $enableAutoblock = 0 ) + $timestamp = '' , $auto = 0, $expiry = '', $anonOnly = 0, $createAccount = 0 ) { $this->mId = 0; $this->mAddress = $address; @@ -37,7 +37,6 @@ class Block $this->mAnonOnly = $anonOnly; $this->mCreateAccount = $createAccount; $this->mExpiry = self::decodeExpiry( $expiry ); - $this->mEnableAutoblock = $enableAutoblock; $this->mForUpdate = false; $this->mFromMaster = false; @@ -73,8 +72,7 @@ class Block { $this->mAddress = $this->mReason = $this->mTimestamp = ''; $this->mId = $this->mAnonOnly = $this->mCreateAccount = - $this->mEnableAutoblock = $this->mAuto = $this->mUser = - $this->mBy = 0; + $this->mAuto = $this->mUser = $this->mBy = 0; $this->mByName = false; } @@ -261,7 +259,6 @@ class Block $this->mAuto = $row->ipb_auto; $this->mAnonOnly = $row->ipb_anon_only; $this->mCreateAccount = $row->ipb_create_account; - $this->mEnableAutoblock = $row->ipb_enable_autoblock; $this->mId = $row->ipb_id; $this->mExpiry = self::decodeExpiry( $row->ipb_expiry ); if ( isset( $row->user_name ) ) { @@ -382,7 +379,6 @@ class Block 'ipb_auto' => $this->mAuto, 'ipb_anon_only' => $this->mAnonOnly, 'ipb_create_account' => $this->mCreateAccount, - 'ipb_enable_autoblock' => $this->mEnableAutoblock, 'ipb_expiry' => self::encodeExpiry( $this->mExpiry, $dbw ), 'ipb_range_start' => $this->mRangeStart, 'ipb_range_end' => $this->mRangeEnd, diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 7568b2eaca..567fd82425 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -55,13 +55,6 @@ class IPBlockForm { } else { $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', true ); } - - if ( $wgRequest->wasPosted() ) { - $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', false ); - } else { - $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', true ); - } - } function showForm( $err ) { @@ -162,18 +155,10 @@ class IPBlockForm { array( 'tabindex' => 5 ) ) . " - -   - - " . wfCheckLabel( wfMsg( 'ipbenableautoblock' ), - 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock, - array( 'tabindex' => 6 ) ) . " - -   - + @@ -257,7 +242,7 @@ class IPBlockForm { $block = new Block( $this->BlockAddress, $userId, $wgUser->getID(), $this->BlockReason, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly, - $this->BlockCreateAccount, $this->BlockEnableAutoblock ); + $this->BlockCreateAccount ); if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) { diff --git a/includes/User.php b/includes/User.php index 06d5107ad6..6bda68e0dc 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1924,10 +1924,6 @@ class User { return; } - if ( !$userblock->mEnableAutoblock ) { - return; - } - # Check if this IP address is already blocked $ipblock = Block::newFromDB( wfGetIP() ); if ( $ipblock ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index bc23e34963..dc8f207f2a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1754,7 +1754,6 @@ pages that were vandalized).", 'ipbreason' => 'Reason', 'ipbanononly' => 'Block anonymous users only', 'ipbcreateaccount' => 'Prevent account creation', -'ipbenableautoblock' => 'Automatically block IP addresses used by this user', 'ipbsubmit' => 'Block this user', 'ipbother' => 'Other time', 'ipboptions' => '2 hours:2 hours,1 day:1 day,3 days:3 days,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,infinite:infinite', diff --git a/maintenance/archives/patch-ipb_optional_autoblock.sql b/maintenance/archives/patch-ipb_optional_autoblock.sql index f31b835955..e69de29bb2 100644 --- a/maintenance/archives/patch-ipb_optional_autoblock.sql +++ b/maintenance/archives/patch-ipb_optional_autoblock.sql @@ -1,3 +0,0 @@ --- Add an extra option field "ipb_enable_autoblock" into the ipblocks table. This allows a block to be placed that does not trigger any autoblocks. - -ALTER TABLE /*$wgDBprefix*/ipblocks ADD COLUMN ipb_enable_autoblock bool NOT NULL default '1'; diff --git a/maintenance/mysql5/tables.sql b/maintenance/mysql5/tables.sql index 9d9c76a7ed..c28c80ba49 100644 --- a/maintenance/mysql5/tables.sql +++ b/maintenance/mysql5/tables.sql @@ -594,9 +594,6 @@ CREATE TABLE /*$wgDBprefix*/ipblocks ( -- Block prevents account creation from matching IP addresses ipb_create_account bool NOT NULL default 1, - - -- Block triggers autoblocks - ipb_enable_autoblock bool NOT NULL default '1', -- Time at which the block will expire. ipb_expiry char(14) binary NOT NULL default '', diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 9f9cb698ed..20e45d9c70 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -582,9 +582,6 @@ CREATE TABLE /*$wgDBprefix*/ipblocks ( -- Block prevents account creation from matching IP addresses ipb_create_account bool NOT NULL default 1, - - -- Block triggers autoblocks - ipb_enable_autoblock bool NOT NULL default '1', -- Time at which the block will expire. ipb_expiry char(14) binary NOT NULL default '', diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 6701498636..db5deafecb 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -38,7 +38,6 @@ $wgNewFields = array( # table field patch file (in maintenance/archives) array( 'ipblocks', 'ipb_id', 'patch-ipblocks.sql' ), array( 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ), - array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ), array( 'recentchanges', 'rc_type', 'patch-rc_type.sql' ), array( 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ), array( 'recentchanges', 'rc_id', 'patch-rc_id.sql' ), @@ -895,7 +894,6 @@ ALTER TABLE recentchanges ALTER rc_cur_id DROP NOT NULL; -- New columns: ALTER TABLE ipblocks ADD ipb_anon_only CHAR NOT NULL DEFAULT '0'; ALTER TABLE ipblocks ADD ipb_create_account CHAR NOT NULL DEFAULT '1'; -ALTER TABLE ipblocks ADD ipb_enable_autoblock CHAR NOT NULL default '1'; -- Index order rearrangements: DROP INDEX pagelink_unique; -- 2.20.1