r41150 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41149‎ | r41150 | r41151 >
Date:13:21, 22 September 2008
Author:aaron
Status:old
Tags:
Comment:
Apply account creation blocks to users (bug 13611)
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1053,8 +1053,10 @@
10541054 $this->spreadBlock();
10551055 }
10561056 } else {
1057 - $this->mBlock = null;
1058 - wfDebug( __METHOD__.": No block.\n" );
 1057+ // Bug 13611, apply account creation blocks to users.
 1058+ // Note that the existence of $this->mBlock is not used
 1059+ // to check for edit blocks, $this->mBlockedby is instead.
 1060+ # $this->mBlock = null;
10591061 }
10601062
10611063 # Proxy blocking
Index: trunk/phase3/includes/Block.php
@@ -79,7 +79,7 @@
8080 $dbr = wfGetDB( DB_SLAVE );
8181 $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*',
8282 array( 'ipb_id' => $id ), __METHOD__ ) );
83 - $block = new Block;
 83+ $block = new Block();
8484 if ( $block->loadFromResult( $res ) ) {
8585 return $block;
8686 } else {
@@ -161,7 +161,9 @@
162162 if ( $user && $this->mAnonOnly ) {
163163 # Block is marked anon-only
164164 # Whitelist this IP address against autoblocks and range blocks
165 - $this->clear();
 165+ if( !$this->mCreateAccount ) {
 166+ $this->clear(); // bug 13611 - keep this data
 167+ }
166168 return false;
167169 } else {
168170 return true;
@@ -172,7 +174,9 @@
173175 # Try range block
174176 if ( $this->loadRange( $address, $killExpired, $user ) ) {
175177 if ( $user && $this->mAnonOnly ) {
176 - $this->clear();
 178+ if( !$this->mCreateAccount ) {
 179+ $this->clear(); // bug 13611 - keep this data
 180+ }
177181 return false;
178182 } else {
179183 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r41221Fix docs for r41150, remove commented-out code, remove superfluous brackets i...tstarling08:46, 24 September 2008