r46812 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46811‎ | r46812 | r46813 >
Date:19:51, 4 February 2009
Author:werdna
Status:deferred
Tags:
Comment:
Allow Abuse Log entries to be examined in the same way recent changes items are.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.i18n.php (modified) (history)
  • /trunk/extensions/AbuseFilter/SpecialAbuseLog.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/SpecialAbuseLog.php
@@ -185,9 +185,11 @@
186186 $parsed_comments = $wgOut->parseInline( $row->af_public_comments );
187187
188188 if ($this->canSeeDetails()) {
 189+ $title = $this->getTitle( "examine/log/".$row->afl_id );
189190 $detailsLink = $sk->makeKnownLinkObj( $this->getTitle( ), wfMsg( 'abusefilter-log-detailslink' ), 'details='.$row->afl_id );
 191+ $examineLink = $sk->link( $title, wfMsgExt( 'abusefilter-changeslist-examine', 'parseinline' ), array() );
190192
191 - $description = wfMsgExt( 'abusefilter-log-detailedentry', array( 'parseinline', 'replaceafter' ), array( $timestamp, $user, $row->afl_filter, $row->afl_action, $sk->makeKnownLinkObj( $title ), $actions_taken, $parsed_comments, $detailsLink ) );
 193+ $description = wfMsgExt( 'abusefilter-log-detailedentry', array( 'parseinline', 'replaceafter' ), array( $timestamp, $user, $row->afl_filter, $row->afl_action, $sk->makeKnownLinkObj( $title ), $actions_taken, $parsed_comments, $detailsLink, $examineLink ) );
192194 } else {
193195 $description = wfMsgExt( 'abusefilter-log-entry', array( 'parseinline', 'replaceafter' ), array( $timestamp, $user, $row->afl_action, $sk->makeKnownLinkObj( $title ), $actions_taken, $parsed_comments ) );
194196 }
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php
@@ -15,7 +15,9 @@
1616
1717 // Check if we've got a subpage
1818 if ( count($this->mParams)>1 && is_numeric($this->mParams[1]) ) {
19 - $this->showExaminer( $this->mParams[1] );
 19+ $this->showExaminerForRC( $this->mParams[1] );
 20+ } elseif ( count($this->mParams)>2 && $this->mParams[1] == 'log' && is_numeric( $this->mParams[2] ) ) {
 21+ $this->showExaminerForLogEntry( $this->mParams[2] );
2022 } else {
2123 $this->showSearch();
2224 }
@@ -78,9 +80,9 @@
7981 $wgOut->addHTML( $output );
8082 }
8183
82 - function showExaminer( $rcid ) {
83 - global $wgOut, $wgUser;
84 -
 84+ function showExaminerForRC( $rcid ) {
 85+ global $wgOut;
 86+
8587 // Get data
8688 $dbr = wfGetDB( DB_SLAVE );
8789 $row = $dbr->selectRow( 'recentchanges', '*', array( 'rc_id' => $rcid ), __METHOD__ );
@@ -92,6 +94,29 @@
9395
9496 $vars = AbuseFilter::getVarsFromRCRow( $row );
9597
 98+ $this->showExaminer( $vars );
 99+ }
 100+
 101+ function showExaminerForLogEntry( $logid ) {
 102+ global $wgOut;
 103+
 104+ // Get data
 105+ $dbr = wfGetDB( DB_SLAVE );
 106+ $row = $dbr->selectRow( 'abuse_filter_log', '*', array( 'afl_id' => $logid ), __METHOD__ );
 107+
 108+ if (!$row) {
 109+ $wgOut->addWikiMsg( 'abusefilter-examine-notfound' );
 110+ return;
 111+ }
 112+
 113+ $vars = unserialize( $row->afl_var_dump );
 114+
 115+ $this->showExaminer( $vars );
 116+ }
 117+
 118+ function showExaminer( $vars ) {
 119+ global $wgOut, $wgUser;
 120+
96121 if (!$vars) {
97122 $wgOut->addWikiMsg( 'abusefilter-examine-incompatible' );
98123 return;
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php
@@ -70,7 +70,7 @@
7171 Filter description: $6',
7272 'abusefilter-log-detailedentry' => '$1: $2 triggered [[Special:AbuseFilter/$3|filter $3]], performing the action "$4" on $5.
7373 Actions taken: $6;
74 -Filter description: $7 ($8)',
 74+Filter description: $7 ($8) ($9)',
7575 'abusefilter-log-detailslink' => 'details',
7676 'abusefilter-log-details-legend' => 'Details for log entry $1',
7777 'abusefilter-log-details-var' => 'Variable',
@@ -406,7 +406,8 @@
407407 * $5 link to page the action that triggered the filter was made on
408408 * $6 actions taken by the filter
409409 * $7 comments in filter description
410 -* $8 filter details link',
 410+* $8 action details link
 411+* $9 link to examine the action',
411412 'abusefilter-log-detailslink' => '{{Identical|Details}}',
412413 'abusefilter-log-details-var' => 'Caption of a column on a detail view of [[Special:AbuseLog]]',
413414 'abusefilter-log-details-val' => 'Caption of a column on a detail view of [[Special:AbuseLog]]

Status & tagging log