r56163 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56162‎ | r56163 | r56164 >
Date:00:30, 11 September 2009
Author:aaron
Status:ok
Tags:
Comment:
(bug 18792) Added block info to "get edits"
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -982,7 +982,9 @@
983983 */
984984 protected function CUChangesLine( $row, $reason ) {
985985 global $wgLang;
986 - # Add date headers
 986+ static $cuTitle, $flagCache;
 987+ $cuTitle = SpecialPage::getTitleFor( 'CheckUser' );
 988+ # Add date headers as needed
987989 $date = $wgLang->date( wfTimestamp(TS_MW,$row->cuc_timestamp), true, true );
988990 if( !isset($this->lastdate) ) {
989991 $this->lastdate = $date;
@@ -1001,18 +1003,25 @@
10021004 # Userlinks
10031005 $line .= $this->sk->userLink( $row->cuc_user, $row->cuc_user_text );
10041006 $line .= $this->sk->userToolLinks( $row->cuc_user, $row->cuc_user_text );
 1007+ # Get block info
 1008+ if( isset($flagCache[$row->cuc_user_text]) ) {
 1009+ $flags = $flagCache[$row->cuc_user_text];
 1010+ } else {
 1011+ $ip = IP::isIPAddress( $row->cuc_user_text ) ? $row->cuc_user_text : '';
 1012+ $flags = $this->userBlockFlags( $ip, $row->cuc_user, $row->cuc_user_text );
 1013+ $flagCache[$row->cuc_user_text] = $flags;
 1014+ }
 1015+ # Add any block information
 1016+ if( count($flags) ) $line .= ' ' . implode(' ',$flags);
10051017 # Action text, hackish ...
10061018 if( $row->cuc_actiontext )
10071019 $line .= ' ' . $this->sk->formatComment( $row->cuc_actiontext ) . ' ';
10081020 # Comment
10091021 $line .= $this->sk->commentBlock( $row->cuc_comment );
1010 -
1011 - $cuTitle = SpecialPage::getTitleFor( 'CheckUser' );
10121022 $line .= '<br />&nbsp; &nbsp; &nbsp; &nbsp; <small>';
10131023 # IP
10141024 $line .= ' <strong>IP</strong>: '.$this->sk->makeKnownLinkObj( $cuTitle,
1015 - htmlspecialchars( $row->cuc_ip ),
1016 - "user=".urlencode( $row->cuc_ip ).'&reason='.urlencode($reason) );
 1025+ htmlspecialchars( $row->cuc_ip ), "user=".urlencode( $row->cuc_ip ).'&reason='.urlencode($reason) );
10171026 # XFF
10181027 if( $row->cuc_xff !=null ) {
10191028 # Flag our trusted proxies

Status & tagging log