From 26a419a2fa4c3fb21aa33cf0dcd19d1241d1c4ea Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 14 Mar 2007 05:38:52 +0000 Subject: [PATCH] *Hide blocks from regular users if ipb_deleted is set --- includes/SpecialIpblocklist.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index 36db0f11d6..6ba3e55688 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -162,7 +162,7 @@ class IPUnblockForm { } function showList( $msg ) { - global $wgOut; + global $wgOut, $wgUser; $wgOut->setPagetitle( wfMsg( "ipblocklist" ) ); if ( "" != $msg ) { @@ -176,6 +176,9 @@ class IPUnblockForm { $conds = array(); $matches = array(); + // Is user allowed to see all the blocks? + if ( !$wgUser->isAllowed( 'oversight' ) ) + $conds['ipb_deleted'] = 0; if ( $this->ip == '' ) { // No extra conditions } elseif ( substr( $this->ip, 0, 1 ) == '#' ) { @@ -299,16 +302,20 @@ class IPUnblockForm { $line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $blocker, $target, $properties ) ); - $s = "
  • {$line}"; - + $unblocklink = ''; if ( $wgUser->isAllowed('block') ) { $titleObj = SpecialPage::getTitleFor( "Ipblocklist" ); - $s .= ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')'; + $unblocklink = ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')'; } - $s .= $sk->commentBlock( $block->mReason ); - $s .= "
  • \n"; + + $comment = $sk->commentBlock( $block->mReason ); + + $s = "{$line} $comment"; + if ( $block->mHideName ) + $s = '' . $s . ''; + wfProfileOut( __METHOD__ ); - return $s; + return "
  • $s $unblocklink
  • \n"; } } -- 2.20.1