r45611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45610‎ | r45611 | r45612 >
Date:18:38, 9 January 2009
Author:aaron
Status:deferred
Tags:
Comment:
Clean up log restrictions check
Modified paths:
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/RecentChange.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RecentChange.php
@@ -473,16 +473,22 @@
474474 RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, true );
475475 }
476476
477 - public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='',
478 - $type, $action, $target, $logComment, $params, $newId=0 )
 477+ public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type,
 478+ $action, $target, $logComment, $params, $newId=0 )
479479 {
 480+ global $wgLogRestrictions;
 481+ # Don't add private logs to RC!
 482+ if( isset($wgLogRestrictions[$type]) && !$wgLogRestrictions[$type] == '*' ) {
 483+ return false;
 484+ }
480485 $rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
481486 $target, $logComment, $params, $newId );
482487 $rc->save();
 488+ return true;
483489 }
484490
485491 public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip='',
486 - $type, $action, $target, $logComment, $params, $newId=0 )
 492+ $type, $action, $target, $logComment, $params, $newId=0 )
487493 {
488494 global $wgRequest;
489495
Index: trunk/phase3/includes/LogPage.php
@@ -80,13 +80,10 @@
8181 }
8282 # And update recentchanges
8383 if( $this->updateRecentChanges ) {
84 - # Don't add private logs to RC!
85 - if( !isset($wgLogRestrictions[$this->type]) || $wgLogRestrictions[$this->type]=='*' ) {
86 - $titleObj = SpecialPage::getTitleFor( 'Log', $this->type );
87 - $rcComment = $this->getRcComment();
88 - RecentChange::notifyLog( $now, $titleObj, $this->doer, $rcComment, '',
89 - $this->type, $this->action, $this->target, $this->comment, $this->params, $newId );
90 - }
 84+ $titleObj = SpecialPage::getTitleFor( 'Log', $this->type );
 85+ $rcComment = $this->getRcComment();
 86+ RecentChange::notifyLog( $now, $titleObj, $this->doer, $rcComment, '', $this->type,
 87+ $this->action, $this->target, $this->comment, $this->params, $newId );
9188 } else if( $this->sendToUDP ) {
9289 # Notify external application via UDP.
9390 # We send this to IRC but do not want to add it the RC table.

Status & tagging log