$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' ) );
$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'];
$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' );
* 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';
}
# 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 );
$user = User::newFromName( $ip );
}
$status = IPBlockForm::checkUnblockSelf( $user );
- if( $status !== true ){
+ if ( $status !== true ) {
throw new ErrorPageError( 'badaccess', $status );
- }
+ }
}
if( $action == 'unblock' ){