From 9f5955b76b07d5a70f543472b183791ce0dd4ea6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 22 Sep 2008 13:21:53 +0000 Subject: [PATCH] Apply account creation blocks to users (bug 13611) --- includes/Block.php | 10 +++++++--- includes/User.php | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index d2a221ff7b..9e12f3332c 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -79,7 +79,7 @@ class Block { $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*', array( 'ipb_id' => $id ), __METHOD__ ) ); - $block = new Block; + $block = new Block(); if ( $block->loadFromResult( $res ) ) { return $block; } else { @@ -161,7 +161,9 @@ class Block { if ( $user && $this->mAnonOnly ) { # Block is marked anon-only # Whitelist this IP address against autoblocks and range blocks - $this->clear(); + if( !$this->mCreateAccount ) { + $this->clear(); // bug 13611 - keep this data + } return false; } else { return true; @@ -172,7 +174,9 @@ class Block { # Try range block if ( $this->loadRange( $address, $killExpired, $user ) ) { if ( $user && $this->mAnonOnly ) { - $this->clear(); + if( !$this->mCreateAccount ) { + $this->clear(); // bug 13611 - keep this data + } return false; } else { return true; diff --git a/includes/User.php b/includes/User.php index 5661c015f0..d0f41b53d9 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1053,8 +1053,10 @@ class User { $this->spreadBlock(); } } else { - $this->mBlock = null; - wfDebug( __METHOD__.": No block.\n" ); + // Bug 13611, apply account creation blocks to users. + // Note that the existence of $this->mBlock is not used + // to check for edit blocks, $this->mBlockedby is instead. + # $this->mBlock = null; } # Proxy blocking -- 2.20.1