r20439 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20438‎ | r20439 | r20440 >
Date:05:38, 14 March 2007
Author:aaron
Status:old
Tags:
Comment:
*Hide blocks from regular users if ipb_deleted is set
Modified paths:
  • /trunk/phase3/includes/SpecialIpblocklist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialIpblocklist.php
@@ -162,7 +162,7 @@
163163 }
164164
165165 function showList( $msg ) {
166 - global $wgOut;
 166+ global $wgOut, $wgUser;
167167
168168 $wgOut->setPagetitle( wfMsg( "ipblocklist" ) );
169169 if ( "" != $msg ) {
@@ -176,6 +176,9 @@
177177
178178 $conds = array();
179179 $matches = array();
 180+ // Is user allowed to see all the blocks?
 181+ if ( !$wgUser->isAllowed( 'oversight' ) )
 182+ $conds['ipb_deleted'] = 0;
180183 if ( $this->ip == '' ) {
181184 // No extra conditions
182185 } elseif ( substr( $this->ip, 0, 1 ) == '#' ) {
@@ -299,16 +302,20 @@
300303
301304 $line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $blocker, $target, $properties ) );
302305
303 - $s = "<li>{$line}";
304 -
 306+ $unblocklink = '';
305307 if ( $wgUser->isAllowed('block') ) {
306308 $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
307 - $s .= ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')';
 309+ $unblocklink = ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')';
308310 }
309 - $s .= $sk->commentBlock( $block->mReason );
310 - $s .= "</li>\n";
 311+
 312+ $comment = $sk->commentBlock( $block->mReason );
 313+
 314+ $s = "{$line} $comment";
 315+ if ( $block->mHideName )
 316+ $s = '<span class="history-deleted">' . $s . '</span>';
 317+
311318 wfProfileOut( __METHOD__ );
312 - return $s;
 319+ return "<li>$s $unblocklink</li>\n";
313320 }
314321 }
315322