Revert patch that was scapped into production without database changes
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 1 Nov 2006 21:36:03 +0000 (21:36 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 1 Nov 2006 21:36:03 +0000 (21:36 +0000)
includes/Block.php
includes/SpecialBlockip.php
includes/User.php
languages/messages/MessagesEn.php
maintenance/archives/patch-ipb_optional_autoblock.sql
maintenance/mysql5/tables.sql
maintenance/tables.sql
maintenance/updaters.inc

index 679ff1e..b11df22 100644 (file)
@@ -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,
index 7568b2e..567fd82 100644 (file)
@@ -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 ) ) . "
                        </td>
                </tr>
-                <tr>
-                        <td>&nbsp;</td>
-                        <td align=\"left\">
-                                " . wfCheckLabel( wfMsg( 'ipbenableautoblock' ),
-                                        'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock,
-                                        array( 'tabindex' => 6 ) ) . "
-                        </td>
-                </tr>
                <tr>
                        <td style='padding-top: 1em'>&nbsp;</td>
                        <td style='padding-top: 1em' align=\"left\">
-                               <input tabindex='7' type='submit' name=\"wpBlock\" value=\"{$mIpbsubmit}\" />
+                               <input tabindex='5' type='submit' name=\"wpBlock\" value=\"{$mIpbsubmit}\" />
                        </td>
                </tr>
        </table>
@@ -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))) {
 
index 06d5107..6bda68e 100644 (file)
@@ -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 ) {
index bc23e34..dc8f207 100644 (file)
@@ -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',
index f31b835..e69de29 100644 (file)
@@ -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';
index 9d9c76a..c28c80b 100644 (file)
@@ -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 '',
index 9f9cb69..20e45d9 100644 (file)
@@ -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 '',
index 6701498..db5deaf 100644 (file)
@@ -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;