Index: trunk/phase3/includes/api/ApiUnblock.php |
— | — | @@ -63,11 +63,11 @@ |
64 | 64 | $this->dieUsageMsg( array( 'cantunblock' ) ); |
65 | 65 | } |
66 | 66 | # bug 15810: blocked admins should have limited access here |
67 | | - if( $wgUser->isBlocked() ){ |
| 67 | + if ( $wgUser->isBlocked() ) { |
68 | 68 | $status = IPBlockForm::checkUnblockSelf( $params['user'] ); |
69 | | - if( $status !== true ){ |
| 69 | + if ( $status !== true ) { |
70 | 70 | $this->dieUsageMsg( array( $status ) ); |
71 | | - } |
| 71 | + } |
72 | 72 | } |
73 | 73 | |
74 | 74 | $id = $params['id']; |
Index: trunk/phase3/includes/api/ApiBlock.php |
— | — | @@ -65,11 +65,11 @@ |
66 | 66 | $this->dieUsageMsg( array( 'cantblock' ) ); |
67 | 67 | } |
68 | 68 | # bug 15810: blocked admins should have limited access here |
69 | | - if( $wgUser->isBlocked() ){ |
| 69 | + if ( $wgUser->isBlocked() ) { |
70 | 70 | $status = IPBlockForm::checkUnblockSelf( $params['user'] ); |
71 | | - if( $status !== true ){ |
| 71 | + if ( $status !== true ) { |
72 | 72 | $this->dieUsageMsg( array( $status ) ); |
73 | | - } |
| 73 | + } |
74 | 74 | } |
75 | 75 | if ( $params['hidename'] && !$wgUser->isAllowed( 'hideuser' ) ) { |
76 | 76 | $this->dieUsageMsg( array( 'canthide' ) ); |
Index: trunk/phase3/includes/specials/SpecialIpblocklist.php |
— | — | @@ -32,8 +32,8 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | # bug 15810: blocked admins should have limited access here |
36 | | - if( $wgUser->isBlocked() ){ |
37 | | - if( $id ){ |
| 36 | + if ( $wgUser->isBlocked() ) { |
| 37 | + if ( $id ) { |
38 | 38 | # This doesn't pick up on autoblocks, but admins |
39 | 39 | # should have the ipblock-exempt permission anyway |
40 | 40 | $block = Block::newFromID( $id ); |
— | — | @@ -42,9 +42,9 @@ |
43 | 43 | $user = User::newFromName( $ip ); |
44 | 44 | } |
45 | 45 | $status = IPBlockForm::checkUnblockSelf( $user ); |
46 | | - if( $status !== true ){ |
| 46 | + if ( $status !== true ) { |
47 | 47 | throw new ErrorPageError( 'badaccess', $status ); |
48 | | - } |
| 48 | + } |
49 | 49 | } |
50 | 50 | |
51 | 51 | if( $action == 'unblock' ){ |
Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -26,11 +26,11 @@ |
27 | 27 | $ipb = new IPBlockForm( $par ); |
28 | 28 | |
29 | 29 | # bug 15810: blocked admins should have limited access here |
30 | | - if( $wgUser->isBlocked() ){ |
| 30 | + if ( $wgUser->isBlocked() ) { |
31 | 31 | $status = IPBlockForm::checkUnblockSelf( $ipb->BlockAddress ); |
32 | | - if( $status !== true ){ |
| 32 | + if ( $status !== true ) { |
33 | 33 | throw new ErrorPageError( 'badaccess', $status ); |
34 | | - } |
| 34 | + } |
35 | 35 | } |
36 | 36 | |
37 | 37 | $action = $wgRequest->getVal( 'action' ); |
— | — | @@ -375,18 +375,16 @@ |
376 | 376 | * either. |
377 | 377 | * @param $user User, Int or String |
378 | 378 | */ |
379 | | - public static function checkUnblockSelf( $user ){ |
| 379 | + public static function checkUnblockSelf( $user ) { |
380 | 380 | global $wgUser; |
381 | | - if( is_int( $user ) ){ |
| 381 | + if ( is_int( $user ) ) { |
382 | 382 | $user = User::newFromId( $user ); |
383 | | - } elseif ( is_string( $user ) ){ |
| 383 | + } elseif ( is_string( $user ) ) { |
384 | 384 | $user = User::newFromName( $user ); |
385 | 385 | } |
386 | | - if( $user instanceof User |
387 | | - && $user->getId() == $wgUser->getId() ) |
388 | | - { |
| 386 | + if( $user instanceof User && $user->getId() == $wgUser->getId() ) { |
389 | 387 | # User is trying to unblock themselves |
390 | | - if( $wgUser->isAllowed( 'unblockself' ) ){ |
| 388 | + if ( $wgUser->isAllowed( 'unblockself' ) ) { |
391 | 389 | return true; |
392 | 390 | } else { |
393 | 391 | return 'ipbnounblockself'; |