r87024 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87023‎ | r87024 | r87025 >
Date:18:09, 27 April 2011
Author:ialex
Status:ok
Tags:
Comment:
Early return if user is excempt from IP blocks
Modified paths:
  • /trunk/extensions/GlobalBlocking/GlobalBlocking.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalBlocking/GlobalBlocking.class.php
@@ -6,6 +6,11 @@
77 if ($action == 'read' || !$wgApplyGlobalBlocks) {
88 return true;
99 }
 10+ if ( $user->isAllowed( 'ipblock-exempt' ) ||
 11+ $user->isAllowed( 'globalblock-exempt' ) ) {
 12+ // User is exempt from IP blocks.
 13+ return true;
 14+ }
1015 $ip = wfGetIp();
1116 $blockError = self::getUserBlockErrors( $user, $ip );
1217 if( !empty($blockError) ) {

Status & tagging log