From: Roan Kattouw Date: Sat, 27 Mar 2010 21:31:10 +0000 (+0000) Subject: Fix coding style in r64230, r64256 X-Git-Tag: 1.31.0-rc.0~37332 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=7e9dcdd61b48009dc4d3f1bd46ddbcfc3ac2f6c9;p=lhc%2Fweb%2Fwiklou.git Fix coding style in r64230, r64256 --- diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index aa36f87a91..a345407435 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -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' ) ); diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index ce49fe3761..f1eb12ae50 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -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']; diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 31edbe2032..8acc9b5759 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -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'; diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php index 1f8795d08c..ccb28992cf 100644 --- a/includes/specials/SpecialIpblocklist.php +++ b/includes/specials/SpecialIpblocklist.php @@ -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' ){