Fix coding style in r64230, r64256
authorRoan Kattouw <catrope@users.mediawiki.org>
Sat, 27 Mar 2010 21:31:10 +0000 (21:31 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sat, 27 Mar 2010 21:31:10 +0000 (21:31 +0000)
includes/api/ApiBlock.php
includes/api/ApiUnblock.php
includes/specials/SpecialBlockip.php
includes/specials/SpecialIpblocklist.php

index aa36f87..a345407 100644 (file)
@@ -65,11 +65,11 @@ class ApiBlock extends ApiBase {
                        $this->dieUsageMsg( array( 'cantblock' ) );
                }
                # bug 15810: blocked admins should have limited access here
-               if( $wgUser->isBlocked() ){
+               if ( $wgUser->isBlocked() ) {
                        $status = IPBlockForm::checkUnblockSelf( $params['user'] );
-                       if( $status !== true ){
+                       if ( $status !== true ) {
                                $this->dieUsageMsg( array( $status ) );
-                       } 
+                       }
                }
                if ( $params['hidename'] && !$wgUser->isAllowed( 'hideuser' ) ) {
                        $this->dieUsageMsg( array( 'canthide' ) );
index ce49fe3..f1eb12a 100644 (file)
@@ -63,11 +63,11 @@ class ApiUnblock extends ApiBase {
                        $this->dieUsageMsg( array( 'cantunblock' ) );
                }
                # bug 15810: blocked admins should have limited access here
-               if( $wgUser->isBlocked() ){
+               if ( $wgUser->isBlocked() ) {
                        $status = IPBlockForm::checkUnblockSelf( $params['user'] );
-                       if( $status !== true ){
+                       if ( $status !== true ) {
                                $this->dieUsageMsg( array( $status ) );
-                       } 
+                       }
                }
 
                $id = $params['id'];
index 31edbe2..8acc9b5 100644 (file)
@@ -26,11 +26,11 @@ function wfSpecialBlockip( $par ) {
        $ipb = new IPBlockForm( $par );
        
        # bug 15810: blocked admins should have limited access here
-       if( $wgUser->isBlocked() ){
+       if ( $wgUser->isBlocked() ) {
                $status = IPBlockForm::checkUnblockSelf( $ipb->BlockAddress );
-               if( $status !== true ){
+               if ( $status !== true ) {
                        throw new ErrorPageError( 'badaccess', $status );
-               } 
+               }
        }
 
        $action = $wgRequest->getVal( 'action' );
@@ -375,18 +375,16 @@ class IPBlockForm {
         * either.
         * @param $user User, Int or String
         */
-       public static function checkUnblockSelf( $user ){
+       public static function checkUnblockSelf( $user ) {
                global $wgUser;
-               if( is_int( $user ) ){
+               if ( is_int( $user ) ) {
                        $user = User::newFromId( $user );
-               } elseif ( is_string( $user ) ){
+               } elseif ( is_string( $user ) ) {
                        $user = User::newFromName( $user );
                }
-               if( $user instanceof User
-                       && $user->getId() == $wgUser->getId() )
-               {
+               if( $user instanceof User && $user->getId() == $wgUser->getId() ) {
                        # User is trying to unblock themselves
-                       if( $wgUser->isAllowed( 'unblockself' ) ){
+                       if ( $wgUser->isAllowed( 'unblockself' ) ) {
                                return true;
                        } else {
                                return 'ipbnounblockself';
index 1f8795d..ccb2899 100644 (file)
@@ -32,8 +32,8 @@ function wfSpecialIpblocklist( $ip = '' ) {
                }
        
                # bug 15810: blocked admins should have limited access here
-               if( $wgUser->isBlocked() ){
-                       if( $id ){
+               if ( $wgUser->isBlocked() ) {
+                       if ( $id ) {
                                # This doesn't pick up on autoblocks, but admins
                                # should have the ipblock-exempt permission anyway
                                $block = Block::newFromID( $id );
@@ -42,9 +42,9 @@ function wfSpecialIpblocklist( $ip = '' ) {
                                $user = User::newFromName( $ip );
                        }
                        $status = IPBlockForm::checkUnblockSelf( $user );
-                       if( $status !== true ){
+                       if ( $status !== true ) {
                                throw new ErrorPageError( 'badaccess', $status );
-                       } 
+                       }
                }
                
                if( $action == 'unblock' ){