From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/specials/SpecialIpblocklist.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'includes/specials/SpecialIpblocklist.php') diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php index 8d573547..4ba1c811 100644 --- a/includes/specials/SpecialIpblocklist.php +++ b/includes/specials/SpecialIpblocklist.php @@ -162,7 +162,7 @@ class IPUnblockForm { * @return array array(message key, parameters) on failure, empty array on success */ - static function doUnblock(&$id, &$ip, &$reason, &$range = null) { + static function doUnblock(&$id, &$ip, &$reason, &$range = null, $blocker=null) { if ( $id ) { $block = Block::newFromID( $id ); if ( !$block ) { @@ -195,11 +195,22 @@ class IPUnblockForm { } // Yes, this is really necessary $id = $block->mId; + + # If the name was hidden and the blocking user cannot hide + # names, then don't allow any block removals... + if( $blocker && $block->mHideName && !$blocker->isAllowed('hideuser') ) { + return array('ipb_cant_unblock', htmlspecialchars($id)); + } # Delete block if ( !$block->delete() ) { return array('ipb_cant_unblock', htmlspecialchars($id)); } + + # Unset _deleted fields as needed + if( $block->mHideName ) { + IPBlockForm::unsuppressUserName( $block->mAddress, $block->mUser ); + } # Make log entry $log = new LogPage( 'block' ); @@ -208,8 +219,8 @@ class IPUnblockForm { } function doSubmit() { - global $wgOut; - $retval = self::doUnblock($this->id, $this->ip, $this->reason, $range); + global $wgOut, $wgUser; + $retval = self::doUnblock($this->id, $this->ip, $this->reason, $range, $wgUser); if(!empty($retval)) { $key = array_shift($retval); @@ -238,7 +249,7 @@ class IPUnblockForm { $conds = array(); $matches = array(); // Is user allowed to see all the blocks? - if ( !$wgUser->isAllowed( 'suppress' ) ) + if ( !$wgUser->isAllowed( 'hideuser' ) ) $conds['ipb_deleted'] = 0; if ( $this->ip == '' ) { // No extra conditions @@ -306,7 +317,7 @@ class IPUnblockForm { } function searchForm() { - global $wgTitle, $wgScript, $wgRequest; + global $wgTitle, $wgScript, $wgRequest, $wgLang; $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) ); $nondefaults = array(); @@ -330,7 +341,7 @@ class IPUnblockForm { $links[] = wfMsgHtml( 'ipblocklist-sh-userblocks', $ubLink ); $links[] = wfMsgHtml( 'ipblocklist-sh-tempblocks', $tbLink ); $links[] = wfMsgHtml( 'ipblocklist-sh-addressblocks', $sipbLink ); - $hl = implode( ' ' . wfMsg( 'pipe-separator' ) . ' ', $links ); + $hl = $wgLang->pipeList( $links ); return Xml::tags( 'form', array( 'action' => $wgScript ), @@ -418,7 +429,7 @@ class IPUnblockForm { $properties[] = $msg['blocklist-nousertalk']; } - $properties = implode( ', ', $properties ); + $properties = $wgLang->commaList( $properties ); $line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $blocker, $target, $properties ) ); @@ -434,7 +445,7 @@ class IPUnblockForm { # Create changeblocklink for all blocks with exception of autoblocks if( !$block->mAuto ) { - $changeblocklink = ' ' . wfMsg( 'pipe-separator' ) . ' ' . + $changeblocklink = wfMsg( 'pipe-separator' ) . $sk->link( SpecialPage::getTitleFor( 'Blockip', $block->mAddress ), $msg['change-blocklink'], array(), array(), 'known' ); -- cgit v1.2.3-54-g00ecf