r49027 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49026‎ | r49027 | r49028 >
Date:06:12, 30 March 2009
Author:werdna
Status:fixme (Comments)
Tags:
Comment:
Implementation of global filters, including a major i18n change for abusefilter-log-detailedentry message (rename and split). Needs further testing before deployment
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.i18n.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilterVariableHolder.php (modified) (history)
  • /trunk/extensions/AbuseFilter/SpecialAbuseLog.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php (modified) (history)
  • /trunk/extensions/AbuseFilter/abusefilter.tables.sql (modified) (history)
  • /trunk/extensions/AbuseFilter/db_patches/patch-global_filters.sql (added) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/SpecialAbuseLog.php
@@ -229,9 +229,21 @@
230230
231231 $title = Title::makeTitle( $row->afl_namespace, $row->afl_title );
232232
233 - $user = $sk->userLink( $row->afl_user, $row->afl_user_text ) .
234 - $sk->userToolLinks( $row->afl_user, $row->afl_user_text );
 233+ if (!$row->afl_wiki) {
 234+ $pageLink = $sk->link( $title );
 235+ } else {
 236+ $pageLink = WikiMap::makeForeignLink( $row->afl_wiki, $row->afl_title );
 237+ }
235238
 239+ if (!$row->afl_wiki) {
 240+ // Local user
 241+ $user = $sk->userLink( $row->afl_user, $row->afl_user_text ) .
 242+ $sk->userToolLinks( $row->afl_user, $row->afl_user_text );
 243+ } else {
 244+ $user = WikiMap::foreignUserLink( $row->afl_wiki, $row->afl_user_text );
 245+ $user .= " (".WikiMap::getWikiName( $row->afl_wiki ) . ")";
 246+ }
 247+
236248 $description = '';
237249
238250 $timestamp = $wgLang->timeanddate( $row->afl_timestamp, true );
@@ -244,13 +256,21 @@
245257 $displayActions = array();
246258
247259 foreach( $actions as $action ) {
248 - $displayActions[] = AbuseFilter::getActionDisplay( $action );;
 260+ $displayActions[] = AbuseFilter::getActionDisplay( $action );
249261 }
250262 $actions_taken = implode( ', ', $displayActions );
251263 }
252 -
 264+
 265+ $globalIndex = AbuseFilter::decodeGlobalName( $row->afl_filter );
 266+
253267 global $wgOut;
254 - $parsed_comments = $wgOut->parseInline( $row->af_public_comments );
 268+ if ($globalIndex) {
 269+ // Pull global filter description
 270+ $parsed_comments =
 271+ $wgOut->parseInline( AbuseFilter::getGlobalFilterDescription( $globalIndex ) );
 272+ } else {
 273+ $parsed_comments = $wgOut->parseInline( $row->af_public_comments );
 274+ }
255275
256276 if ($this->canSeeDetails()) {
257277 $examineTitle = SpecialPage::getTitleFor( 'AbuseFilter', "examine/log/".$row->afl_id );
@@ -262,15 +282,31 @@
263283 $examineTitle,
264284 wfMsgExt( 'abusefilter-changeslist-examine', 'parseinline' ),
265285 array() );
266 -
267 - $description = wfMsgExt( 'abusefilter-log-detailedentry',
 286+
 287+ if ($globalIndex) {
 288+ global $wgAbuseFilterCentralDB;
 289+ $globalURL =
 290+ WikiMap::getForeignURL( $wgAbuseFilterCentralDB,
 291+ 'Special:AbuseFilter/'.$globalIndex );
 292+
 293+ $linkText = wfMsgExt( 'abusefilter-log-detailedentry-global',
 294+ 'parseinline', array($globalIndex) );
 295+
 296+ $filterLink = $sk->makeExternalLink( $globalURL, $linkText );
 297+ } else {
 298+ $title = SpecialPage::getTitleFor( 'AbuseFilter', $row->afl_filter );
 299+ $linkText = wfMsgExt( 'abusefilter-log-detailedentry-local',
 300+ 'parseinline', array($row->afl_filter) );
 301+ $filterLink = $sk->link( $title, $linkText );
 302+ }
 303+ $description = wfMsgExt( 'abusefilter-log-detailedentry-meta',
268304 array( 'parseinline', 'replaceafter' ),
269305 array(
270306 $timestamp,
271307 $user,
272 - $row->afl_filter,
 308+ $filterLink,
273309 $row->afl_action,
274 - $sk->link( $title ),
 310+ $pageLink,
275311 $actions_taken,
276312 $parsed_comments,
277313 $detailsLink,
@@ -313,12 +349,17 @@
314350 function getQueryInfo() {
315351 $conds = $this->mConds;
316352
317 - $conds[] = 'af_id=afl_filter';
318 -
319353 return array(
320354 'tables' => array('abuse_filter_log','abuse_filter'),
321355 'fields' => '*',
322356 'conds' => $conds,
 357+ 'join_conds' =>
 358+ array( 'abuse_filter' =>
 359+ array(
 360+ 'LEFT JOIN',
 361+ 'af_id=afl_filter',
 362+ ),
 363+ ),
323364 );
324365 }
325366
Index: trunk/extensions/AbuseFilter/AbuseFilter.php
@@ -110,3 +110,8 @@
111111 $wgAbuseFilterUDPPrefix = 'abusefilter:';
112112 $wgAbuseFilterUDPAddress = null;
113113 $wgAbuseFilterUDPPort = null;
 114+
 115+// Centralised filters
 116+$wgAbuseFilterCentralDB = null;
 117+$wgAbuseFilterIsCentral = false;
 118+
Index: trunk/extensions/AbuseFilter/db_patches/patch-global_filters.sql
@@ -0,0 +1,7 @@
 2+-- Patch to add support for global filters
 3+
 4+ALTER TABLE /*_*/abuse_filter ADD COLUMN af_global tinyint(1) NOT NULL DEFAULT 0;
 5+
 6+ALTER TABLE /*_*/abuse_filter_log ADD COLUMN afl_wiki varchar(64) binary NULL;
 7+ALTER TABLE /*_*/abuse_filter_log CHANGE COLUMN afl_filter afl_filter varchar(64) binary NOT NULL;
 8+ALTER TABLE /*_*/abuse_filter_log ADD COLUMN afl_deleted tinyint(1) NULL;
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php
@@ -153,7 +153,9 @@
154154 'tables' => array('abuse_filter', 'abuse_filter_action'),
155155 'fields' => array(
156156 'af_id',
157 - '(af_enabled | af_deleted << 1) AS status',
 157+ 'af_enabled',
 158+ 'af_deleted',
 159+ 'af_global',
158160 'af_public_comments',
159161 'af_hidden',
160162 'af_hit_count',
@@ -220,12 +222,19 @@
221223 }
222224 return htmlspecialchars( implode( ', ', $displayActions ) );
223225 case 'status':
224 - if ($value & 2)
225 - return wfMsgExt( 'abusefilter-deleted', 'parseinline' );
226 - elseif ($value & 1)
227 - return wfMsgExt( 'abusefilter-enabled', 'parseinline' );
 226+ $statuses = array();
 227+ if ($row->af_deleted)
 228+ $statuses[] = wfMsgExt( 'abusefilter-deleted', 'parseinline' );
 229+ elseif ($row->af_enabled)
 230+ $statuses[] = wfMsgExt( 'abusefilter-enabled', 'parseinline' );
228231 else
229 - return wfMsgExt( 'abusefilter-disabled', 'parseinline' );
 232+ $statuses[] = wfMsgExt( 'abusefilter-disabled', 'parseinline' );
 233+
 234+ global $wgAbuseFilterIsCentral;
 235+ if ($row->af_global && $wgAbuseFilterIsCentral)
 236+ $statuses[] = wfMsgExt( 'abusefilter-status-global', 'parseinline' );
 237+
 238+ return $wgLang->commaList( $statuses );
230239 case 'af_hidden':
231240 $msg = $value ? 'abusefilter-hidden' : 'abusefilter-unhidden';
232241 return wfMsgExt( $msg, 'parseinline' );
@@ -266,9 +275,9 @@
267276 }
268277
269278 function getRowClass( $row ) {
270 - if ($row->status & 1) {
 279+ if ($row->af_enabled) {
271280 return 'mw-abusefilter-list-enabled';
272 - } elseif ($row->status & 2) {
 281+ } elseif ($row->af_deleted) {
273282 return 'mw-abusefilter-list-deleted';
274283 } else {
275284 return 'mw-abusefilter-list-disabled';
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php
@@ -178,8 +178,8 @@
179179 if ($name == 'afh_flags') {
180180 // This is a bit freaky, but it works.
181181 // Basically, returns true if any of those filters are in the $changed array.
182 - $filters = array( 'af_enabled', 'af_hidden', 'af_deleted' );
183 - if ( count( array_diff( $filters, $changed ) ) < 3 ) {
 182+ $filters = array( 'af_enabled', 'af_hidden', 'af_deleted', 'af_global' );
 183+ if ( count( array_diff( $filters, $changed ) ) < count($filters) ) {
184184 $fieldChanged = true;
185185 }
186186 } elseif ( in_array( $mappings[$name], $changed ) ) {
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php
@@ -148,6 +148,8 @@
149149 $flags[] = 'enabled';
150150 if ($newRow['af_deleted'])
151151 $flags[] = 'deleted';
 152+ if ($newRow['af_global'])
 153+ $flags[] = 'global';
152154
153155 $afh_row['afh_flags'] = implode( ",", $flags );
154156
@@ -280,6 +282,10 @@
281283 // Build checkboxen
282284 $checkboxes = array( 'hidden', 'enabled', 'deleted' );
283285 $flags = '';
 286+
 287+ global $wgAbuseFilterIsCentral;
 288+ if ($wgAbuseFilterIsCentral)
 289+ $checkboxes[] = 'global';
284290
285291 if (isset($row->af_throttled) && $row->af_throttled) {
286292 global $wgAbuseFilterEmergencyDisableThreshold;
@@ -582,6 +588,7 @@
583589 $obj->af_pattern = '';
584590 $obj->af_enabled = 1;
585591 $obj->af_hidden = 0;
 592+ $obj->af_global = 0;
586593 return array( $obj, array() );
587594 }
588595
@@ -641,6 +648,8 @@
642649 $row->af_deleted = $wgRequest->getBool( 'wpFilterDeleted' );
643650 $row->af_enabled = $wgRequest->getBool( 'wpFilterEnabled' ) && !$row->af_deleted;
644651 $row->af_hidden = $wgRequest->getBool( 'wpFilterHidden' );
 652+ global $wgAbuseFilterIsCentral;
 653+ $row->af_global = $wgRequest->getBool( 'wpFilterGlobal' ) && $wgAbuseFilterIsCentral;
645654
646655 // Actions
647656 global $wgAbuseFilterAvailableActions;
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -372,38 +372,31 @@
373373 public static function checkAllFilters( $vars ) {
374374 // Fetch from the database.
375375 wfProfileIn( __METHOD__ );
376 - $dbr = wfGetDB( DB_SLAVE );
377 - $res = $dbr->select( 'abuse_filter', '*', array( 'af_enabled' => 1, 'af_deleted' => 0 ) );
378376
379377 // Sampling profiler
380378 $profile = rand(0,50);
381379 $profile = ($profile == 1) ? true : false;
382380
383381 $filter_matched = array();
 382+
 383+ $dbr = wfGetDB( DB_SLAVE );
 384+ $res = $dbr->select( 'abuse_filter', '*', array( 'af_enabled' => 1, 'af_deleted' => 0 ) );
384385
385386 while ( $row = $dbr->fetchObject( $res ) ) {
386 - if ($profile)
387 - $startTime = microtime(true);
388 - // Store the row somewhere convenient
389 - self::$filters[$row->af_id] = $row;
390 -
391 - // Check conditions...
392 - $pattern = trim($row->af_pattern);
393 - if ( self::checkConditions( $pattern, $vars, true /* ignore errors */,
394 - 'keepvars' ) ) {
395 - // Record match.
396 - $filter_matched[$row->af_id] = true;
397 - } else {
398 - // Record non-match.
399 - $filter_matched[$row->af_id] = false;
400 - }
 387+ $filter_matched[$row->af_id] = self::checkFilter( $row, $vars, $profile );
 388+ }
 389+
 390+ global $wgAbuseFilterCentralDB, $wgAbuseFilterIsCentral;
 391+ if ($wgAbuseFilterCentralDB && !$wgAbuseFilterIsCentral) {
 392+ // Global filters
 393+ $fdb = wfGetDB( DB_SLAVE, array(), $wgAbuseFilterCentralDB );
 394+ $res = $fdb->select( 'abuse_filter', '*',
 395+ array( 'af_enabled' => 1, 'af_deleted' => 0,
 396+ 'af_global' => 1 ) );
401397
402 - if ($profile) {
403 - $endTime = microtime(true);
404 -
405 - $timeTaken = $endTime - $startTime;
406 -
407 - self::recordProfilingResult( $row->af_id, $timeTaken );
 398+ while ( $row = $fdb->fetchObject( $res ) ) {
 399+ $filter_matched["global-".$row->af_id] =
 400+ self::checkFilter( $row, $vars, $profile, 'global-' );
408401 }
409402 }
410403
@@ -415,6 +408,37 @@
416409 return $filter_matched;
417410 }
418411
 412+ public static function checkFilter( $row, $vars, $profile = false, $prefix = '' ) {
 413+ $filterID = $prefix.$row->af_id;
 414+
 415+ if ($profile)
 416+ $startTime = microtime(true);
 417+
 418+ // Store the row somewhere convenient
 419+ self::$filters[$filterID] = $row;
 420+
 421+ // Check conditions...
 422+ $pattern = trim($row->af_pattern);
 423+ if ( self::checkConditions( $pattern, $vars, true /* ignore errors */,
 424+ 'keepvars' ) ) {
 425+ // Record match.
 426+ $result = true;
 427+ } else {
 428+ // Record non-match.
 429+ $result = false;
 430+ }
 431+
 432+ if ($profile) {
 433+ $endTime = microtime(true);
 434+
 435+ $timeTaken = $endTime - $startTime;
 436+
 437+ self::recordProfilingResult( $row->af_id, $timeTaken );
 438+ }
 439+
 440+ return $result;
 441+ }
 442+
419443 public static function resetFilterProfile( $filter ) {
420444 global $wgMemc;
421445 $countKey = wfMemcKey( 'abusefilter', 'profile', $filter, 'count' );
@@ -457,22 +481,58 @@
458482 $profile = ($curTotal / $curCount) * 1000;
459483 return round( $profile, 2); // Return in ms, rounded to 2dp
460484 }
461 -
462 - /** Returns an array [ list of actions taken by filter, error message to display, if any ] */
463 - public static function executeFilterActions( $filters, $title, $vars ) {
464 - wfProfileIn( __METHOD__ );
465 - static $blockingActions = array( 'block', 'rangeblock', 'degroup',
466 - 'blockautopromote' );
 485+
 486+ /** Utility function to decode global-$index to $index. Returns false if not global */
 487+ public static function decodeGlobalName( $filter ) {
 488+ if ( strpos( $filter, 'global-' ) == 0 ) {
 489+ return substr( $filter, strlen('global-') );
 490+ }
467491
 492+ return false;
 493+ }
 494+
 495+ public static function getConsequencesForFilters( $filters ) {
 496+ $globalFilters = array();
 497+ $localFilters = array();
 498+
 499+ foreach( $filters as $filter ) {
 500+ $globalIndex = self::decodeGlobalName( $filter );
 501+
 502+ if ($globalIndex)
 503+ $globalFilters[] = $globalIndex;
 504+ else
 505+ $localFilters[] = $filter;
 506+ }
 507+
 508+ global $wgAbuseFilterCentralDB;
 509+ // Load local filter info
468510 $dbr = wfGetDB( DB_SLAVE );
469511 // Retrieve the consequences.
 512+ $consequences = array();
 513+
 514+ if ( count($localFilters) ) {
 515+ $consequences = self::loadConsequencesFromDB( $dbr, $localFilters );
 516+ }
 517+
 518+ if ( count($globalFilters) ) {
 519+ $fdb = wfGetDB( DB_SLAVE, array(), $wgAbuseFilterCentralDB );
 520+ $consequences = array_merge( $consequences,
 521+ self::loadConsequencesFromDB( $fdb, $globalFilters, 'global-' ) );
 522+ }
 523+
 524+ return $consequences;
 525+ }
 526+
 527+ public static function loadConsequencesFromDB( $dbr, $filters, $prefix='' ) {
 528+ $actionsByFilter = array();
 529+ foreach( $filters as $filter ) {
 530+ $actionsByFilter[$prefix.$filter] = array();
 531+ }
 532+
470533 $res = $dbr->select( array('abuse_filter_action', 'abuse_filter'), '*',
471534 array( 'af_id' => $filters ), __METHOD__, array(),
472535 array( 'abuse_filter_action' => array('LEFT JOIN', 'afa_filter=af_id') ) );
473 -
474 - $actionsByFilter = array_fill_keys( $filters, array() );
475 - $actionsTaken = array_fill_keys( $filters, array() );
476 -
 536+
477537 // Categorise consequences by filter.
478538 global $wgAbuseFilterRestrictedActions;
479539 while ( $row = $dbr->fetchObject( $res ) ) {
@@ -482,15 +542,27 @@
483543 ## Don't do the action
484544 } elseif ( $row->afa_filter != $row->af_id ) {
485545 // We probably got a NULL, as it's a LEFT JOIN.
486 - // Don't add it anyway.
 546+ // Don't add it.
487547 } else {
488 - $actionsByFilter[$row->afa_filter][$row->afa_consequence] = array(
 548+ $actionsByFilter[$prefix.$row->afa_filter][$row->afa_consequence] = array(
489549 'action' => $row->afa_consequence,
490550 'parameters' => explode( "\n", $row->afa_parameters )
491551 );
492552 }
493553 }
 554+
 555+ return $actionsByFilter;
 556+ }
494557
 558+ /** Returns an array [ list of actions taken by filter, error message to display, if any ] */
 559+ public static function executeFilterActions( $filters, $title, $vars ) {
 560+ wfProfileIn( __METHOD__ );
 561+ static $blockingActions = array( 'block', 'rangeblock', 'degroup',
 562+ 'blockautopromote' );
 563+
 564+ $actionsByFilter = self::getConsequencesForFilters( $filters );
 565+ $actionsTaken = array_fill_keys( $filters, array() );
 566+
495567 wfLoadExtensionMessages( 'AbuseFilter' );
496568
497569 $messages = array();
@@ -597,16 +669,13 @@
598670
599671 list( $actions_taken, $error_msg ) = self::executeFilterActions(
600672 array_keys( array_filter( $filter_matched ) ), $title, $vars );
601 -
602 - $var_dump = self::storeVarDump( $vars );
603 - $var_dump = "stored-text:$var_dump"; // To distinguish from stuff stored directly
 673+
604674 $action = $vars->getVar( 'ACTION' )->toString();
605675
606676 // Create a template
607677 $log_template = array(
608678 'afl_user' => $wgUser->getId(),
609679 'afl_user_text' => $wgUser->getName(),
610 - 'afl_var_dump' => $var_dump,
611680 'afl_timestamp' => $dbr->timestamp(wfTimestampNow()),
612681 'afl_namespace' => $title->getNamespace(),
613682 'afl_title' => $title->getDBKey(),
@@ -617,7 +686,7 @@
618687 $log_template['afl_user_text'] = $vars->getVar( 'accountname' )->toString();
619688 }
620689
621 - self::addLogEntries( $actions_taken, $log_template, $action );
 690+ self::addLogEntries( $actions_taken, $log_template, $action, $vars );
622691
623692 $error_msg = $error_msg == '' ? true : $error_msg;
624693
@@ -628,14 +697,21 @@
629698 return $error_msg;
630699 }
631700
632 - public static function addLogEntries( $actions_taken, $log_template, $action ) {
 701+ public static function addLogEntries( $actions_taken, $log_template, $action, $vars ) {
633702 wfProfileIn( __METHOD__ );
634703 $dbw = wfGetDB( DB_MASTER );
 704+
 705+ $central_log_template = array(
 706+ 'afl_wiki' => wfWikiId(),
 707+ );
635708
636709 $log_rows = array();
637 - $logged_filters = array();
 710+ $central_log_rows = array();
 711+ $logged_local_filters = array();
 712+ $logged_global_filters = array();
638713
639714 foreach( $actions_taken as $filter => $actions ) {
 715+ $globalIndex = self::decodeGlobalName( $filter );
640716 $thisLog = $log_template;
641717 $thisLog['afl_filter'] = $filter;
642718 $thisLog['afl_action'] = $action;
@@ -644,7 +720,22 @@
645721 // Don't log if we were only throttling.
646722 if ( $thisLog['afl_actions'] != 'throttle' ) {
647723 $log_rows[] = $thisLog;
648 - $logged_filters[] = $filter;
 724+
 725+ if (!$globalIndex)
 726+ $logged_local_filters[] = $filter;
 727+
 728+ // Global logging
 729+ if ($globalIndex) {
 730+ $title = Title::makeTitle( $thisLog['afl_namespace'],
 731+ $thisLog['afl_title'] );
 732+ $centralLog = $thisLog + $central_log_template;
 733+ $centralLog['afl_filter'] = $globalIndex;
 734+ $centralLog['afl_title'] = $title->getPrefixedText();
 735+ $centralLog['afl_namespace'] = 0;
 736+
 737+ $central_log_rows[] = $centralLog;
 738+ $logged_global_filters[] = $globalIndex;
 739+ }
649740 }
650741 }
651742
@@ -653,6 +744,14 @@
654745 return;
655746 }
656747
 748+ // Only store the var dump if we're actually going to add log rows.
 749+ $var_dump = self::storeVarDump( $vars );
 750+ $var_dump = "stored-text:$var_dump"; // To distinguish from stuff stored directly
 751+
 752+ foreach( $log_rows as $index => $data ) {
 753+ $log_rows[$index]['afl_var_dump'] = $var_dump;
 754+ }
 755+
657756 wfProfileIn( __METHOD__.'-hitstats' );
658757
659758 global $wgMemc;
@@ -662,14 +761,35 @@
663762
664763 $dbw->insert( 'abuse_filter_log', $log_rows, __METHOD__ );
665764
666 - // Update hit-counter.
667 - $dbw->update( 'abuse_filter', array( 'af_hit_count=af_hit_count+1' ),
668 - array( 'af_id' => $logged_filters ),
669 - __METHOD__ );
 765+ if ( count($logged_local_filters) ) {
 766+ // Update hit-counter.
 767+ $dbw->update( 'abuse_filter', array( 'af_hit_count=af_hit_count+1' ),
 768+ array( 'af_id' => $logged_local_filters ),
 769+ __METHOD__ );
 770+ }
 771+
 772+ // Global stuff
 773+ if ( count($logged_global_filters) ) {
 774+ $vars->computeDBVars();
 775+ $global_var_dump = self::storeVarDump( $vars, 'global' );
 776+ $global_var_dump = "stored-text:$global_var_dump";
 777+ foreach( $central_log_rows as $index => $data ) {
 778+ $central_log_rows[$index]['afl_var_dump'] = $global_var_dump;
 779+ }
 780+
 781+ global $wgAbuseFilterCentralDB;
 782+ $fdb = wfGetDB( DB_MASTER, array(), $wgAbuseFilterCentralDB );
670783
 784+ $fdb->insert( 'abuse_filter_log', $central_log_rows, __METHOD__ );
 785+
 786+ $fdb->update( 'abuse_filter', array( 'af_hit_count=af_hit_count+1' ),
 787+ array( 'af_id' => $logged_global_filters ),
 788+ __METHOD__ );
 789+ }
 790+
671791 // Check for emergency disabling.
672792 $total = $wgMemc->get( AbuseFilter::filterUsedKey() );
673 - self::checkEmergencyDisable( $logged_filters, $total );
 793+ self::checkEmergencyDisable( $logged_local_filters, $total );
674794
675795 wfProfileOut( __METHOD__.'-hitstats' );
676796
@@ -678,7 +798,7 @@
679799
680800 /** Store a var dump to External Storage or the text table
681801 * Some of this code is stolen from Revision::insertOn and friends */
682 - public static function storeVarDump( $vars ) {
 802+ public static function storeVarDump( $vars, $global = false ) {
683803 wfProfileIn( __METHOD__ );
684804
685805 if ( is_array( $vars ) || is_object( $vars ) )
@@ -693,9 +813,12 @@
694814 }
695815
696816 // Store to ES if applicable
697 - global $wgDefaultExternalStore;
 817+ global $wgDefaultExternalStore, $wgAbuseFilterCentralDB;
698818 if ($wgDefaultExternalStore) {
699 - $text = ExternalStore::insertToDefault( $text );
 819+ if ($global)
 820+ $text = ExternalStore::insertToForeignDefault( $text, $wgAbuseFilterCentralDB );
 821+ else
 822+ $text = ExternalStore::insertToDefault( $text );
700823 $flags[] = 'external';
701824
702825 if (!$text)
@@ -704,7 +827,10 @@
705828 }
706829
707830 // Store to text table
708 - $dbw = wfGetDB( DB_MASTER );
 831+ if ($global)
 832+ $dbw = wfGetDB( DB_MASTER, array(), $wgAbuseFilterCentralDB );
 833+ else
 834+ $dbw = wfGetDB( DB_MASTER );
709835 $old_id = $dbw->nextSequenceValue( 'text_old_id_val' );
710836 $dbw->insert( 'text',
711837 array(
@@ -1185,7 +1311,8 @@
11861312 'af_comments',
11871313 'af_deleted',
11881314 'af_enabled',
1189 - 'af_hidden'
 1315+ 'af_hidden',
 1316+ 'af_global',
11901317 );
11911318 $differences = array();
11921319
@@ -1499,4 +1626,15 @@
15001627 RecentChange::sendToUDP( $data, $wgAbuseFilterUDPAddress, $wgAbuseFilterUDPPrefix,
15011628 $wgAbuseFilterUDPPort );
15021629 }
 1630+
 1631+ static function getGlobalFilterDescription( $filterID ) {
 1632+ global $wgAbuseFilterCentralDB;
 1633+
 1634+ if (!$wgAbuseFilterCentralDB) return;
 1635+
 1636+ $fdb = wfGetDB( DB_SLAVE, array(), $wgAbuseFilterCentralDB );
 1637+
 1638+ return $fdb->selectField( 'abuse_filter', 'af_public_comments',
 1639+ array( 'af_id' => $filterID ), __METHOD__ );
 1640+ }
15031641 }
Index: trunk/extensions/AbuseFilter/AbuseFilterVariableHolder.php
@@ -67,6 +67,23 @@
6868 return $exported;
6969 }
7070
 71+ /** Compute all vars which need DB access. Useful for vars which are going to be saved
 72+ * cross-wiki or used for offline analysis */
 73+ function computeDBVars() {
 74+ static $dbTypes = array( 'links-from-wikitext-or-database', 'load-recent-authors',
 75+ 'get-page-restrictions', 'simple-user-accessor',
 76+ 'user-age', 'user-groups', 'revision-text-by-id',
 77+ 'revision-text-by-timestamp' );
 78+
 79+ foreach( $this->mVars as $name => $value ) {
 80+ if ($value instanceof AFComputedVariable &&
 81+ in_array( $value->mMethod, $dbTypes ) ) {
 82+ $value = $value->compute( $this );
 83+ $this->setVar( $name, $value );
 84+ }
 85+ }
 86+ }
 87+
7188 }
7289
7390 class AFComputedVariable {
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php
@@ -80,9 +80,11 @@
8181 'abusefilter-log-entry' => '$1: $2 triggered an abuse filter, performing the action "$3" on $4.
8282 Actions taken: $5;
8383 Filter description: $6',
84 - 'abusefilter-log-detailedentry' => '$1: $2 triggered [[Special:AbuseFilter/$3|filter $3]], performing the action "$4" on $5.
 84+ 'abusefilter-log-detailedentry-meta' => '$1: $2 triggered $3, performing the action "$4" on $5.
8585 Actions taken: $6;
8686 Filter description: $7 ($8) ($9)',
 87+ 'abusefilter-log-detailedentry-global' => 'global filter $1',
 88+ 'abusefilter-log-detailedentry-local' => 'filter $1',
8789 'abusefilter-log-detailslink' => 'details',
8890 'abusefilter-log-details-legend' => 'Details for log entry $1',
8991 'abusefilter-log-details-var' => 'Variable',
@@ -118,6 +120,7 @@
119121 'abusefilter-tools' => 'Abuse filter tools',
120122 'abusefilter-loglink' => 'View the abuse log',
121123 'abusefilter-return' => 'Return to filter management',
 124+ 'abusefilter-status-global' => 'Global',
122125
123126 // Options form
124127 'abusefilter-list-options' => 'Options',
@@ -204,6 +207,7 @@
205208 'abusefilter-edit-revert' => 'Revert actions taken by this filter',
206209 'abusefilter-edit-tools' => 'Tools:',
207210 'abusefilter-edit-test-link' => 'Test this filter against recent edits',
 211+ 'abusefilter-edit-global' => 'Apply this filter globally',
208212
209213 // Filter editing helpers
210214 'abusefilter-edit-builder-select' => 'Select an option to add it at the cursor',
@@ -296,6 +300,7 @@
297301 'abusefilter-history-foruser' => 'Changes by $1',
298302 'abusefilter-history-hidden' => 'Hidden',
299303 'abusefilter-history-enabled' => 'Enabled',
 304+ 'abusefilter-history-global' => 'Global',
300305 'abusefilter-history-timestamp' => 'Time',
301306 'abusefilter-history-user' => 'User',
302307 'abusefilter-history-public' => 'Public filter description',
@@ -460,10 +465,10 @@
461466 * $4 link to page the action that triggered the filter was made on
462467 * $5 actions taken by the filter
463468 * $6 comments in filter description',
464 - 'abusefilter-log-detailedentry' => 'This message is for a log entry.
 469+ 'abusefilter-log-detailedentry-meta' => 'This message is for a log entry.
465470 * $1 timestamp
466471 * $2 user
467 -* $3 filter name
 472+* $3 link to filter
468473 * $4 action by user
469474 * $5 link to page the action that triggered the filter was made on
470475 * $6 actions taken by the filter
@@ -1325,9 +1330,10 @@
13261331 'abusefilter-log-entry' => '$1: $2 выклікаў фільтар злоўжываньняў, выконваючы дзеяньне «$3» на $4.
13271332 Прынятыя меры: $5;
13281333 Апісаньне фільтру: $6',
1329 - 'abusefilter-log-detailedentry' => '$1: $2 выклікаў [[Special:AbuseFilter/$3|фільтар $3]], выконваючы дзеяньне «$4» на $5.
 1334+ 'abusefilter-log-detailedentry-meta' => '$1: $2 выклікаў $3, выконваючы дзеяньне «$4» на $5.
13301335 Прынятыя меры: $6;
13311336 Апісаньне фільтру: $7 ($8) ($9)',
 1337+ 'abusefilter-log-detailedentry-local' => 'фільтар $1',
13321338 'abusefilter-log-detailslink' => 'падрабязнасьці',
13331339 'abusefilter-log-details-legend' => 'Падрабязнасьці запісу ў журнале $1',
13341340 'abusefilter-log-details-var' => 'Зьменная',
@@ -1669,7 +1675,8 @@
16701676 'abusefilter-log-search-title' => 'Заглавие:',
16711677 'abusefilter-log-search-submit' => 'Търсене',
16721678 'abusefilter-log-entry' => '$1: $2 задейства защитен филтър, извършвайки $3 на $4. Последвали действия: $5; Описание на филтъра: $6',
1673 - 'abusefilter-log-detailedentry' => '$1: $2 задейства [[Special:AbuseFilter/$3|филтър $3]], извършвайки $4 на $5. Последвали действия: $6; Описание на филтъра: $7 ($8)',
 1679+ 'abusefilter-log-detailedentry-meta' => '$1: $2 задейства $3, извършвайки $4 на $5. Последвали действия: $6; Описание на филтъра: $7 ($8)',
 1680+ 'abusefilter-log-detailedentry-local' => 'филтър $1',
16741681 'abusefilter-log-detailslink' => 'детайли',
16751682 'abusefilter-log-details-legend' => 'Детайли за запис от дневника $1',
16761683 'abusefilter-log-details-var' => 'Променлива',
@@ -1876,7 +1883,8 @@
18771884 'abusefilter-log-entry' => '$1: Korisnik $2 je pokrenuo filter za zloupotrebu, napravivši akciju "$3" na $4.
18781885 Napravljena akcija: $5;
18791886 Opis filtera: $6',
1880 - 'abusefilter-log-detailedentry' => '$1: Korisnik $2 pokrenuo [[Special:AbuseFilter/$3|filter $3]], napravivši akciju "$4" na $5. Napravljena akcija: $6; Opis filtera: $7 ($8) ($9)',
 1887+ 'abusefilter-log-detailedentry-meta' => '$1: Korisnik $2 pokrenuo $3, napravivši akciju "$4" na $5. Napravljena akcija: $6; Opis filtera: $7 ($8) ($9)',
 1888+ 'abusefilter-log-detailedentry-local' => 'filter $1',
18811889 'abusefilter-log-detailslink' => 'detalji',
18821890 'abusefilter-log-details-legend' => 'Detalji podataka u logu $1',
18831891 'abusefilter-log-details-var' => 'Varijabla (promjenjiva)',
@@ -2256,8 +2264,9 @@
22572265 'abusefilter-log-search-submit' => 'Hledat',
22582266 'abusefilter-log-entry' => '$1: $2 {{GENDER:$2|spustil|spustila|spustil}} filtr zneužívání při činnosti „$3“ na $4.
22592267 Provedená opatření: $5; popis filtru: $6',
2260 - 'abusefilter-log-detailedentry' => '$1: $2 {{GENDER:$2|spustil|spustila|spustil}} [[Special:AbuseFilter/$3|filtr $3]] při činnosti „$4“ na $5.
 2268+ 'abusefilter-log-detailedentry-meta' => '$1: $2 {{GENDER:$2|spustil|spustila|spustil}} $3 při činnosti „$4“ na $5.
22612269 Provedená opatření: $6; popis filtru: $7 ($8) ($9)',
 2270+ 'abusefilter-log-detailedentry-local' => 'filtr $1',
22622271 'abusefilter-log-detailslink' => 'podrobnosti',
22632272 'abusefilter-log-details-legend' => 'Podrobnosti záznamu $1',
22642273 'abusefilter-log-details-var' => 'Proměnná',
@@ -2622,9 +2631,10 @@
26232632 'abusefilter-log-entry' => '$1: $2 löste einen Missbrauchsfilter aus, indem er die Aktion „$3“ auf „$4“ anwendete.
26242633 Filteraktion: „$5“;
26252634 Filterbeschreibung: „$6“',
2626 - 'abusefilter-log-detailedentry' => '$1: $2 löste den [[Special:AbuseFilter/$3|Filter $3]] aus, indem er die Aktion „$4“ auf „$5“ anwendete.
 2635+ 'abusefilter-log-detailedentry-meta' => '$1: $2 löste den $3 aus, indem er die Aktion „$4“ auf „$5“ anwendete.
26272636 Ergriffene Maßnahmen: $6;
26282637 Filterbeschreibung: $7 ($8) ($9)',
 2638+ 'abusefilter-log-detailedentry-local' => 'Filter $1',
26292639 'abusefilter-log-detailslink' => 'Details',
26302640 'abusefilter-log-details-legend' => 'Details für den Logbuch-Eintrag $1',
26312641 'abusefilter-log-details-var' => 'Variable',
@@ -3015,7 +3025,8 @@
30163026 'abusefilter-log-search-title' => 'Titel:',
30173027 'abusefilter-log-search-submit' => 'Pytaś',
30183028 'abusefilter-log-entry' => '$1: $2 jo filter znjewužywanja zapušćił a cynił akciju $3 na $4. Wuwjeźone akcije: $5; Wopisanje filtra: $6',
3019 - 'abusefilter-log-detailedentry' => '$1: $2 jo zapušćił [[Special:AbuseFilter/$3|filter $3]] a jo pśewjadł akciju "$4" na $5. Wuwjeźone akcije: $6; Wopisanje filtra: $7 ($8) ($9)',
 3029+ 'abusefilter-log-detailedentry-meta' => '$1: $2 jo zapušćił $3 a jo pśewjadł akciju "$4" na $5. Wuwjeźone akcije: $6; Wopisanje filtra: $7 ($8) ($9)',
 3030+ 'abusefilter-log-detailedentry-local' => 'filter $1',
30203031 'abusefilter-log-detailslink' => 'Drobnosći',
30213032 'abusefilter-log-details-legend' => 'Drobnosći za protokolowy zapisk $1',
30223033 'abusefilter-log-details-var' => 'Wariabla',
@@ -4303,9 +4314,10 @@
43044315 'abusefilter-log-entry' => '$1 : $2 a déclenché un filtre antiabus, lors de l’action « $3 » sur $4.
43054316 Actions prises : $5 ;
43064317 Description du filtre : $6',
4307 - 'abusefilter-log-detailedentry' => '$1 : $2 a déclenché le [[Special:AbuseFilter/$3|filtre antiabus $3]], lors de l’action « $4 » sur $5.
 4318+ 'abusefilter-log-detailedentry-meta' => '$1 : $2 a déclenché le $3, lors de l’action « $4 » sur $5.
43084319 Actions prises : $6 ;
43094320 Description du filtre : $7 ($8) ($9)',
 4321+ 'abusefilter-log-detailedentry-local' => 'filtre antiabus $1',
43104322 'abusefilter-log-detailslink' => 'détails',
43114323 'abusefilter-log-details-legend' => 'Détails pour l’entrée $1 du journal',
43124324 'abusefilter-log-details-var' => 'Variable',
@@ -4678,9 +4690,10 @@
46794691 'abusefilter-log-entry' => '$1: $2 accionou un filtro de abusos, levando a cabo a acción "$3" en $4.
46804692 Accións levadas a cabo: $5.
46814693 Descrición do filtro: $6',
4682 - 'abusefilter-log-detailedentry' => '$1: $2 accionou [[Special:AbuseFilter/$3|o filtro $3]], levando a cabo a acción "$4" en $5.
 4694+ 'abusefilter-log-detailedentry-meta' => '$1: $2 accionou $3, levando a cabo a acción "$4" en $5.
46834695 Accións levadas a cabo: $6.
46844696 Descrición do filtro: $7 ($8) ($9)',
 4697+ 'abusefilter-log-detailedentry-local' => 'o filtro $1',
46854698 'abusefilter-log-detailslink' => 'detalles',
46864699 'abusefilter-log-details-legend' => 'Detalles para a entrada $1 do rexistro',
46874700 'abusefilter-log-details-var' => 'Variable',
@@ -5092,7 +5105,8 @@
50935106 'abusefilter-log-search-title' => 'Titel:',
50945107 'abusefilter-log-search-submit' => 'Sueche',
50955108 'abusefilter-log-entry' => '$1: $2 het e Missbrauchsfilter uusglest dur d Aawändig vu $3 uf $4. Aktion: $5; Filterbschryybig: $6',
5096 - 'abusefilter-log-detailedentry' => '$1: $2 het dr [[Special:AbuseFilter/$3|Filter $3]] uusglest. Dees verursacht het e $4 uf $5. Ergriffeni Maßnahme: $6; Filterbschryybung: $7 ($8) ($9)',
 5109+ 'abusefilter-log-detailedentry-meta' => '$1: $2 het dr $3 uusglest. Dees verursacht het e $4 uf $5. Ergriffeni Maßnahme: $6; Filterbschryybung: $7 ($8) ($9)',
 5110+ 'abusefilter-log-detailedentry-local' => 'Filter $1',
50975111 'abusefilter-log-detailslink' => 'Detail',
50985112 'abusefilter-log-details-legend' => 'Detail fir dr Logbuech-Yytrag $1',
50995113 'abusefilter-log-details-var' => 'Variable',
@@ -5833,9 +5847,10 @@
58345848 'abusefilter-log-entry' => '$1: $2 pokrenuo je filtar zloporabe, vršeći radnju "$3" na $4.
58355849 Poduzete radnje: $5;
58365850 Opis filtra: $6',
5837 - 'abusefilter-log-detailedentry' => '$1: $2 pokrenuo je [[Special:AbuseFilter/$3|filtar $3]], vršeći radnju "$4" na $5.
 5851+ 'abusefilter-log-detailedentry-meta' => '$1: $2 pokrenuo je $3, vršeći radnju "$4" na $5.
58385852 Poduzete radnje: $6;
58395853 Opis filtra: $7 ($8) ($9)',
 5854+ 'abusefilter-log-detailedentry-local' => 'filtar $1',
58405855 'abusefilter-log-detailslink' => 'detalji',
58415856 'abusefilter-log-details-legend' => 'Detalji zapisa $1',
58425857 'abusefilter-log-details-var' => 'Varijabla',
@@ -6106,9 +6121,10 @@
61076122 'abusefilter-log-entry' => '$1: $2 pušći znjewužiwanski filter přez wuwjedźenje akcije "$3" na $4.
61086123 Přewjedźene akcije: $5;
61096124 Wopisanje filtra: $6',
6110 - 'abusefilter-log-detailedentry' => '$1: $2 pušći [[Special:AbuseFilter/$3|filter $3]] přez wuwjedźenje akcije "$4" na $5.
 6125+ 'abusefilter-log-detailedentry-meta' => '$1: $2 pušći $3 přez wuwjedźenje akcije "$4" na $5.
61116126 Přewjedźene akcije: $6;
61126127 Wopisanje filtra:: $7 ($8) ($9)',
 6128+ 'abusefilter-log-detailedentry-local' => 'filter $1',
61136129 'abusefilter-log-detailslink' => 'podrobnosće',
61146130 'abusefilter-log-details-legend' => 'Podrobnosće za protokolowy zapisk $1',
61156131 'abusefilter-log-details-var' => 'Wariabla',
@@ -6655,9 +6671,10 @@
66566672 'abusefilter-log-entry' => '$1: $2 activava un filtro anti-abuso, executante le action "$3" in $4.
66576673 Actiones interprendite: $5;
66586674 Description del filtro: $6',
6659 - 'abusefilter-log-detailedentry' => '$1: $2 activava le [[Special:AbuseFilter/$3|filtro $3]], executante le action "$4" in $5.
 6675+ 'abusefilter-log-detailedentry-meta' => '$1: $2 activava le $3, executante le action "$4" in $5.
66606676 Actiones interprendite: $6;
66616677 Description del filtro: $7 ($8) ($9)',
 6678+ 'abusefilter-log-detailedentry-local' => 'filtro $1',
66626679 'abusefilter-log-detailslink' => 'detalios',
66636680 'abusefilter-log-details-legend' => 'Detalios pro le entrata $1 del registro',
66646681 'abusefilter-log-details-var' => 'Variabile',
@@ -7001,7 +7018,8 @@
70027019 'abusefilter-log-search-title' => 'Judul:',
70037020 'abusefilter-log-search-submit' => 'Cari',
70047021 'abusefilter-log-entry' => '$1: $2 memicu filter penyalahgunaan, melakukan $3 pada $4. Tindakan yang diambil: $5; Keterangan filter: $6',
7005 - 'abusefilter-log-detailedentry' => '$1: $2 memicu filter penyalahgunaan $3, melakukan $4 pada $5. Tindakan yang diambil: $6; Keterangan filter: $7 ($8)',
 7022+ 'abusefilter-log-detailedentry-meta' => '$1: $2 memicu filter penyalahgunaan $3, melakukan $4 pada $5. Tindakan yang diambil: $6; Keterangan filter: $7 ($8)',
 7023+ 'abusefilter-log-detailedentry-local' => 'filter $1',
70067024 'abusefilter-log-detailslink' => 'rincian',
70077025 'abusefilter-log-details-legend' => 'Rincian untuk entri log $1',
70087026 'abusefilter-log-details-var' => 'Variable',
@@ -7214,9 +7232,10 @@
72157233 'abusefilter-log-entry' => '$1: $2 ha provocato l\'attivazione di un filtro anti abusi con l\'azione "$3" su $4.
72167234 Azioni intraprese: $5;
72177235 Descrizione del filtro: $6',
7218 - 'abusefilter-log-detailedentry' => '$1: $2 ha provocato l\'attivazione [[Special:AbuseFilter/$3|del filtro $3]] con l\'azione "$4" su $5.
 7236+ 'abusefilter-log-detailedentry-meta' => '$1: $2 ha provocato l\'attivazione $3 con l\'azione "$4" su $5.
72197237 Azioni intraprese: $6;
72207238 Descrizione del filtro: $7 ($8) ($9)',
 7239+ 'abusefilter-log-detailedentry-local' => 'del filtro $1',
72217240 'abusefilter-log-detailslink' => 'dettagli',
72227241 'abusefilter-log-details-legend' => 'Dettagli della voce di registro $1',
72237242 'abusefilter-log-details-var' => 'Variabile',
@@ -7563,9 +7582,10 @@
75647583 'abusefilter-log-entry' => '$1: $2 が $4 で「$3」操作を行い不正利用フィルターに引っかかりました。
75657584 対処アクション: $5;
75667585 フィルター解説: $6',
7567 - 'abusefilter-log-detailedentry' => '$1: $2 が $5 で「$4」操作を行い[[Special:AbuseFilter/$3|フィルター $3]] に引っかかりました。
 7586+ 'abusefilter-log-detailedentry-meta' => '$1: $2 が $5 で「$4」操作を行い$3 に引っかかりました。
75687587 対処アクション: $6;
75697588 フィルター解説: $7 ($8) ($9)',
 7589+ 'abusefilter-log-detailedentry-local' => 'フィルター $1',
75707590 'abusefilter-log-detailslink' => '詳細',
75717591 'abusefilter-log-details-legend' => '記録項目 $1 の詳細',
75727592 'abusefilter-log-details-var' => '変数',
@@ -8228,9 +8248,10 @@
82298249 'abusefilter-log-search-submit' => 'Söhke!',
82308250 'abusefilter-log-entry' => "$1: {{GENDER:$2|dä|et|dä Metmaacher|dat|de}} $2 hät met „$3“ op dä Sigg $4
82318251 dä Meßbruchsfelter op der Plan jeroofe, un dä däät dat: $5. De Rääjel explezeet: ''$6''.",
8232 - 'abusefilter-log-detailedentry' => '$1: {{GENDER:$2|dä|et|dä Metmaacher|dat|de}} $2 hät met „$4“ op dä Sigg $5
8233 -däm [[Special:AbuseFilter/$3|Meßbruchsfelter sing Rääjel $3]] jetroffe,
 8252+ 'abusefilter-log-detailedentry-meta' => '$1: {{GENDER:$2|dä|et|dä Metmaacher|dat|de}} $2 hät met „$4“ op dä Sigg $5
 8253+däm $3 jetroffe,
82348254 un dä Felter hät: $6. De Rääjel explezeet: $7 ($8) ($9)',
 8255+ 'abusefilter-log-detailedentry-local' => 'Meßbruchsfelter sing Rääjel $1',
82358256 'abusefilter-log-detailslink' => 'Einzelheite aanloore',
82368257 'abusefilter-log-details-legend' => 'Einzelheite för dä Logbooch-Endraach $1',
82378258 'abusefilter-log-details-var' => 'Date (Speicher Name)',
@@ -8875,9 +8896,10 @@
88768897 'abusefilter-log-entry' => '$1: $2 leet \'ne misbroekfilter aafgaon bie \'t oetveure hanjeling "$3" op $4.
88778898 Genaome maatregel: $5.
88788899 Filterbesjrieving: $6',
8879 - 'abusefilter-log-detailedentry' => '$1: $2 leet [[Special:AbuseFilter/$3|filter $3]] aafgaon bie \'t oetveure van de hanjeling "$4" op $5.
 8900+ 'abusefilter-log-detailedentry-meta' => '$1: $2 leet $3 aafgaon bie \'t oetveure van de hanjeling "$4" op $5.
88808901 Genaome maatregel: $6.
88818902 Filterbesjrieving: $7 ($8) ($9)',
 8903+ 'abusefilter-log-detailedentry-local' => 'filter $1',
88828904 'abusefilter-log-detailslink' => 'kleinighijjer',
88838905 'abusefilter-log-details-legend' => 'Details veur logregel $1',
88848906 'abusefilter-log-details-var' => 'Variabel',
@@ -9376,9 +9398,10 @@
93779399 'abusefilter-log-entry' => '$1: $2 hett en Missbruukfilter utlööst, as he de Akschoon „$3“ op „$4“ anwennt hett.
93789400 Filterakschoon: „$5“;
93799401 Wat dat för’n Filter is: „$6“',
9380 - 'abusefilter-log-detailedentry' => '$1: $2 hett den [[Special:AbuseFilter/$3|Filter $3]] utlööst, as he de Akschoon „$4“ op „$5“ anwennt hett.
 9402+ 'abusefilter-log-detailedentry-meta' => '$1: $2 hett den $3 utlööst, as he de Akschoon „$4“ op „$5“ anwennt hett.
93819403 Filterakschoon: $6;
93829404 Wat dat för’n Filter is: $7 ($8) ($9)',
 9405+ 'abusefilter-log-detailedentry-local' => 'Filter $1',
93839406 'abusefilter-log-detailslink' => 'Details',
93849407 'abusefilter-log-details-legend' => 'Details för Logbook-Indrag $1',
93859408 'abusefilter-log-details-var' => 'Variable',
@@ -9745,9 +9768,10 @@
97469769 'abusefilter-log-entry' => '$1: $2 liet een misbruikfilter afgaan bij het uitvoeren handeling "$3" op $4.
97479770 Genomen maatregel: $5.
97489771 Filterbeschrijving: $6',
9749 - 'abusefilter-log-detailedentry' => '$1: $2 liet [[Special:AbuseFilter/$3|filter $3]] afgaan bij het uitvoeren van de handeling "$4" op $5.
 9772+ 'abusefilter-log-detailedentry-meta' => '$1: $2 liet $3 afgaan bij het uitvoeren van de handeling "$4" op $5.
97509773 Genomen maatregel: $6.
97519774 Filterbeschrijving: $7 ($8) ($9)',
 9775+ 'abusefilter-detailedentry-local' => 'filter $1',
97529776 'abusefilter-log-detailslink' => 'details',
97539777 'abusefilter-log-details-legend' => 'Details voor logboekregel $1',
97549778 'abusefilter-log-details-var' => 'Variabele',
@@ -10098,7 +10122,8 @@
1009910123 'abusefilter-log-search-title' => 'Tittel:',
1010010124 'abusefilter-log-search-submit' => 'Søk',
1010110125 'abusefilter-log-entry' => '$1: $2 utløyste eit misbruksfilter ved å gjera handlinga «$3» på $4. Reaksjon: $5; Filterskildring: $6',
10102 - 'abusefilter-log-detailedentry' => '$1: $2 utløyste [[Special:AbuseFilter/$3|misbruksfilter $3]] ved å utføra handlinga «$4» på $5. Reaksjon: $6; Filterskildring: $7 ($8) ($9)',
 10126+ 'abusefilter-log-detailedentry-meta' => '$1: $2 utløyste $3 ved å utføra handlinga «$4» på $5. Reaksjon: $6; Filterskildring: $7 ($8) ($9)',
 10127+ 'abusefilter-log-detailedentry-local' => 'misbruksfilter $1',
1010310128 'abusefilter-log-detailslink' => 'detaljar',
1010410129 'abusefilter-log-details-legend' => 'Detaljar for loggelementet $1',
1010510130 'abusefilter-log-details-var' => 'Variabel',
@@ -10439,9 +10464,10 @@
1044010465 'abusefilter-log-entry' => '$1: $2 utløste misbruksfilteret ved å gjøre en $3 på $4.
1044110466 Reaksjon: $5;
1044210467 filterbeskrivelse: $6',
10443 - 'abusefilter-log-detailedentry' => '$1: $2 utløste misbruksfilter [[Special:AbuseFilter/$3|filter $3]], ved å gjøre en $4 på $5.
 10468+ 'abusefilter-log-detailedentry-meta' => '$1: $2 utløste misbruksfilter $3, ved å gjøre en $4 på $5.
1044410469 Reaksjon: $6;
1044510470 Filterbeskrivelse: $7 ($8) ($9)',
 10471+ 'abusefilter-log-detailedentry-local' => 'filter $1',
1044610472 'abusefilter-log-detailslink' => 'detaljer',
1044710473 'abusefilter-log-details-legend' => 'Detaljer for loggelement $1',
1044810474 'abusefilter-log-details-var' => 'Variabel',
@@ -10770,9 +10796,10 @@
1077110797 'abusefilter-log-entry' => "$1 : $2 a desenclavat un filtre dels abuses, qu'executa l'accion « $3 » sus $4.
1077210798 Accions presas : $5 ;
1077310799 Descripcion del filtre : $6",
10774 - 'abusefilter-log-detailedentry' => "$1 : $2 a desenclavat lo [[Special:AbuseFilter/$3|filtre $3 dels abuses]], en executant l'accion « $4 » sur $5.
 10800+ 'abusefilter-log-detailedentry-meta' => "$1 : $2 a desenclavat lo $3, en executant l'accion « $4 » sur $5.
1077510801 Accions presas : $6 ;
1077610802 Descripcion del filtre : $7 ($8) ($9)",
 10803+ 'abusefilter-log-detailedentry-local' => 'filtre $1 dels abuses',
1077710804 'abusefilter-log-detailslink' => 'detalhs',
1077810805 'abusefilter-log-details-legend' => "Detalhs per l'entrada $1 del jornal",
1077910806 'abusefilter-log-details-var' => 'Variabla',
@@ -11161,9 +11188,10 @@
1116211189 'abusefilter-log-entry' => '$1: $2 uruchomił filtr nadużyć, wykonał „$3” na $4.
1116311190 Podjęta akcja: $5.
1116411191 Opis filtru: $6',
11165 - 'abusefilter-log-detailedentry' => '$1: $2 uruchomił [[Special:AbuseFilter/$3|filtr $3]], wykonał „$4” na $5.
 11192+ 'abusefilter-log-detailedentry-meta' => '$1: $2 uruchomił $3, wykonał „$4” na $5.
1116611193 Podjęta akcja: $6.
1116711194 Opis filtru: $7 ($8) ($9)',
 11195+ 'abusefilter-log-detailedentry-local' => 'filtr $1',
1116811196 'abusefilter-log-detailslink' => 'szczegóły',
1116911197 'abusefilter-log-details-legend' => 'Szczegóły wpisu w rejestrze $1',
1117011198 'abusefilter-log-details-var' => 'Zmienna',
@@ -11543,9 +11571,10 @@
1154411572 'abusefilter-log-entry' => '$1: $2 despoletou um filtro de abuso, executando a ação "$3" em $4.
1154511573 Ações tomadas: $5;
1154611574 Descrição do filtro: $6',
11547 - 'abusefilter-log-detailedentry' => '$1: $2 despoletou o [[Special:AbuseFilter/$3|filtro $3]], executando a ação "$4" em $5.
 11575+ 'abusefilter-log-detailedentry-meta' => '$1: $2 despoletou o $3, executando a ação "$4" em $5.
1154811576 Ações tomadas: $6;
1154911577 Descrição do filtro: $7 ($8) ($9)',
 11578+ 'abusefilter-log-detailedentry-local' => 'filtro $1',
1155011579 'abusefilter-log-detailslink' => 'detalhes',
1155111580 'abusefilter-log-details-legend' => 'Detalhes para entrada de registo $1',
1155211581 'abusefilter-log-details-var' => 'Variável',
@@ -11898,7 +11927,8 @@
1189911928 'abusefilter-log-search-title' => 'Titlu:',
1190011929 'abusefilter-log-search-submit' => 'Caută',
1190111930 'abusefilter-log-entry' => '$1: $2 a declanşat un filtru abuz, executând $3 asupra $4. Măsura luată: $5; Descrierea filtrului: $6',
11902 - 'abusefilter-log-detailedentry' => '$1: $2 a declanşat [[Special:AbuseFilter/$3|filtrul $3]], executând $4 asupra $5. Măsura luată: $6; Descrierea filtrului: $7 ($8)',
 11931+ 'abusefilter-log-detailedentry-meta' => '$1: $2 a declanşat $3, executând $4 asupra $5. Măsura luată: $6; Descrierea filtrului: $7 ($8)',
 11932+ 'abusefilter-log-detailedentry-local' => 'filtrul $1',
1190311933 'abusefilter-log-detailslink' => 'detalii',
1190411934 'abusefilter-log-details-legend' => 'Detalii pentru intrarea $1 din jurnal',
1190511935 'abusefilter-log-details-var' => 'Variabilă',
@@ -12149,9 +12179,10 @@
1215012180 'abusefilter-log-entry' => '$1: $2 вызвал срабатывание фильтра злоупотреблений, действие «$3» на странице $4.
1215112181 Предпринятие меры: $5.
1215212182 Описание фильтра: $6',
12153 - 'abusefilter-log-detailedentry' => '$1: $2 вызвал срабатывание [[Special:AbuseFilter/$3|фильтра $3]], действие «$4» на странице $5.
 12183+ 'abusefilter-log-detailedentry-meta' => '$1: $2 вызвал срабатывание $3, действие «$4» на странице $5.
1215412184 Предпринятые меры: $6.
1215512185 Описание фильтра: $7 ($8) ($9)',
 12186+ 'abusefilter-log-detailedentry-local' => 'фильтра $1',
1215612187 'abusefilter-log-detailslink' => 'подробности',
1215712188 'abusefilter-log-details-legend' => 'Подробности записи журнала $1',
1215812189 'abusefilter-log-details-var' => 'Переменная',
@@ -12506,9 +12537,10 @@
1250712538 'abusefilter-log-entry' => '$1: киниттэн сылтаан - $2 - омсо сиидэтэ үлэлээбит, «$3» дьайыыны $4 сирэйгэ оҥорбут.
1250812539 Оҥоһуллубут дьайыылар: $5.
1250912540 Сиидэ туһунан: $6',
12510 - 'abusefilter-log-detailedentry' => '$1: $2 кыттааччыттан сылтаан [[Special:AbuseFilter/$3|$3 сиидэ]] үлэлээбит, «$4» дьайыыны $5 сирэйгэ оҥорбут.
 12541+ 'abusefilter-log-detailedentry-meta' => '$1: $2 кыттааччыттан сылтаан $3 үлэлээбит, «$4» дьайыыны $5 сирэйгэ оҥорбут.
1251112542 Оҥоһуллубут дьайыылар: $6.
1251212543 Сиидэ туһунан: $7 ($8) ($9)',
 12544+ 'abusefilter-log-detailedentry-local' => '$1 сиидэ',
1251312545 'abusefilter-log-detailslink' => 'сиһилии',
1251412546 'abusefilter-log-details-legend' => '$1 сурунаал суруга сиһилии',
1251512547 'abusefilter-log-details-var' => 'Уларыйар кэриҥ (переменная)',
@@ -12830,9 +12862,10 @@
1283112863 'abusefilter-log-entry' => '$1: $2 spustil filter zneužití, pri vykonávaní „$3“ na $4.
1283212864 Vykonané opatrenia: $5;
1283312865 Popis filtra: $6',
12834 - 'abusefilter-log-detailedentry' => '$1: $2 spustil filter [[Special:AbuseFilter/$3|filter $3]], vynkonaná operácia „$4“ na $5.
 12866+ 'abusefilter-log-detailedentry-meta' => '$1: $2 spustil filter $3, vynkonaná operácia „$4“ na $5.
1283512867 Vykonané opatrenia: $6;
1283612868 Popis filtra: $7 ($8) ($9)',
 12869+ 'abusefilter-log-detailedentry-local' => 'filter $1',
1283712870 'abusefilter-log-detailslink' => 'podrobnosti',
1283812871 'abusefilter-log-details-legend' => 'Podrobnosti položky záznamu $1',
1283912872 'abusefilter-log-details-var' => 'Premenná',
@@ -13190,7 +13223,8 @@
1319113224 'abusefilter-log-search-title' => 'Tittel:',
1319213225 'abusefilter-log-search-submit' => 'Säike (uk ap Düütsk5)',
1319313226 'abusefilter-log-entry' => '$1: $2 löösde ne Misbruuks-Sieuwe uut, truch dät hie $3 ap $4 moakede. Aktion: $5; Sieuwe-Beschrieuwenge: $6',
13194 - 'abusefilter-log-detailedentry' => '$1: $2 häd ju [[Special:AbuseFilter/$3|Sieuwe $3]] uutlöösd, wät n $4 ap $5 feruurseeked. Ärgriepene Mäitenoamen: $6; Sieuwebeschrieuwenge: $7 ($8)',
 13227+ 'abusefilter-log-detailedentry-meta' => '$1: $2 häd ju $3 uutlöösd, wät n $4 ap $5 feruurseeked. Ärgriepene Mäitenoamen: $6; Sieuwebeschrieuwenge: $7 ($8)',
 13228+ 'abusefilter-log-detailedentry-local' => 'Sieuwe $1',
1319513229 'abusefilter-log-detailslink' => 'Eenpeldhaide',
1319613230 'abusefilter-log-details-legend' => 'Eenpeldhaide foar dän Logbouk-Iendraach $1',
1319713231 'abusefilter-log-details-var' => 'Variable',
@@ -13420,9 +13454,10 @@
1342113455 'abusefilter-log-entry' => '$1: $2 utlöste ett missbruksfilter genom att göra handlingen "$3" på $4.
1342213456 Utförd handling: $5;
1342313457 Filterbeskrivning: $6',
13424 - 'abusefilter-log-detailedentry' => '$1: $2 utlöste [[Special:AbuseFilter/$3|filter $3]], genom att göra handlingen "$4" på $5.
 13458+ 'abusefilter-log-detailedentry-meta' => '$1: $2 utlöste $3, genom att göra handlingen "$4" på $5.
1342513459 Utförd handling: $6;
1342613460 Filterbeskrivning: $7 ($8) ($9)',
 13461+ 'abusefilter-log-detailedentry-local' => 'filter $1',
1342713462 'abusefilter-log-detailslink' => 'detaljer',
1342813463 'abusefilter-log-details-legend' => 'Detaljer för loggelement $1',
1342913464 'abusefilter-log-details-var' => 'Variabel',
@@ -13869,7 +13904,8 @@
1387013905 'abusefilter-log-entry' => '$1: nagpagalaw si $2 ng isang pansala ng pang-aabuso, na nagsagawa ng $3 sa $4.
1387113906 Mga kilos na ginawa: $5;
1387213907 Paglalarawan ng pansala: $6',
13873 - 'abusefilter-log-detailedentry' => '$1: nagpagalaw si $2 ng [[Special:AbuseFilter/$3|pansalang $3]], na nagsagawa ng kilos na $4 sa $5. Mga kilos na ginawa: $6; Paglalarawan ng pansala: $7 ($8) ($9)',
 13908+ 'abusefilter-log-detailedentry-meta' => '$1: nagpagalaw si $2 ng $3, na nagsagawa ng kilos na $4 sa $5. Mga kilos na ginawa: $6; Paglalarawan ng pansala: $7 ($8) ($9)',
 13909+ 'abusefilter-log-detailedentry-local' => 'pansalang $1',
1387413910 'abusefilter-log-detailslink' => 'mga detalye',
1387513911 'abusefilter-log-details-legend' => 'Mga detalye para sa ipinasok sa talang $1',
1387613912 'abusefilter-log-details-var' => 'Pabagu-bago',
@@ -14224,9 +14260,10 @@
1422514261 'abusefilter-log-entry' => '$1: $2 bir suistimal filtresini tetikledi, $4 sayfasında "$3" eylemi yapılıyor.
1422614262 Yapılan eylemler: $5;
1422714263 Filtre açıklaması: $6',
14228 - 'abusefilter-log-detailedentry' => '$1: $2, [[Special:AbuseFilter/$3|$3 süzgecini]] tetikledi, $5 sayfasında "$4" eylemi yapılıyor.
 14264+ 'abusefilter-log-detailedentry-meta' => '$1: $2, $3 tetikledi, $5 sayfasında "$4" eylemi yapılıyor.
1422914265 Yapılan eylemler: $6;
1423014266 Süzgeç açıklaması: $7 ($8) ($9)',
 14267+ 'abusefilter-log-detailedentry-local' => '$1 süzgecini',
1423114268 'abusefilter-log-detailslink' => 'ayrıntılar',
1423214269 'abusefilter-log-details-legend' => '$1 günlük girdisi için ayrıntılar',
1423314270 'abusefilter-log-details-var' => 'Değişken',
@@ -14571,9 +14608,10 @@
1457214609 'abusefilter-log-search-title' => 'Заголовок:',
1457314610 'abusefilter-log-search-submit' => 'Знайти',
1457414611 'abusefilter-log-entry' => '$1: $2 запустив фільтр зловживань, виконуючи "$3" на сторінці "$4". Прийняті заходи: $5; опис фільтру: $6',
14575 - 'abusefilter-log-detailedentry' => '$1: $2 запустив [[Special:AbuseFilter/$3|фільтр $3]], виконуючи "$4" на сторінці "$5".
 14612+ 'abusefilter-log-detailedentry-meta' => '$1: $2 запустив $3, виконуючи "$4" на сторінці "$5".
1457614613 Вжиті заходи: $6.
1457714614 Опис фільтру: $7 ($8) ($9)',
 14615+ 'abusefilter-log-detailedentry-local' => 'фільтр $1',
1457814616 'abusefilter-log-detailslink' => 'деталі',
1457914617 'abusefilter-log-details-legend' => 'Деталі журнального запису $1',
1458014618 'abusefilter-log-details-var' => 'Змінна',
@@ -14897,9 +14935,10 @@
1489814936 'abusefilter-log-search-title' => 'Tựa đề:',
1489914937 'abusefilter-log-search-submit' => 'Tìm kiếm',
1490014938 'abusefilter-log-entry' => '$1: $2 đã kích hoạt bộ lọc sai phạm, thực hiện tác động “$3” vào lúc $4. Tác vụ diễn ra: $5; Mô tả bộ lọc: $6',
14901 - 'abusefilter-log-detailedentry' => '$1: $2 đã kích hoạt [[Special:AbuseFilter/$3|bộ lọc $3]], thực hiện tác vụ “$4” trên $5.
 14939+ 'abusefilter-log-detailedentry-meta' => '$1: $2 đã kích hoạt $3, thực hiện tác vụ “$4” trên $5.
1490214940 Tác vụ thực hiện: $6;
1490314941 Mô tả bộ lọc: $7 ($8) ($9)',
 14942+ 'abusefilter-log-detailedentry-local' => 'bộ lọc $1',
1490414943 'abusefilter-log-detailslink' => 'chi tiết',
1490514944 'abusefilter-log-details-legend' => 'Chi tiết cho mục nhật trình $1',
1490614945 'abusefilter-log-details-var' => 'Biến',
Index: trunk/extensions/AbuseFilter/abusefilter.tables.sql
@@ -14,6 +14,7 @@
1515 af_throttled tinyint(1) NOT NULL default 0,
1616 af_deleted tinyint(1) NOT NULL DEFAULT 0,
1717 af_actions varchar(255) NOT NULL DEFAULT '',
 18+ af_global tinyint(1) NOT NULL DEFAULT 0,
1819
1920 PRIMARY KEY (af_id),
2021 KEY (af_user)
@@ -30,7 +31,7 @@
3132
3233 CREATE TABLE /*$wgDBprefix*/abuse_filter_log (
3334 afl_id BIGINT unsigned NOT NULL AUTO_INCREMENT,
34 - afl_filter BIGINT unsigned NOT NULL,
 35+ afl_filter varchar(64) binary NOT NULL,
3536 afl_user BIGINT unsigned NOT NULL,
3637 afl_user_text varchar(255) binary NOT NULL,
3738 afl_ip varchar(255) not null,
@@ -40,6 +41,8 @@
4142 afl_timestamp binary(14) NOT NULL,
4243 afl_namespace tinyint NOT NULL,
4344 afl_title varchar(255) binary NOT NULL,
 45+ afl_wiki varchar(64) binary NULL,
 46+ afl_deleted tinyint(1) NULL,
4447
4548 PRIMARY KEY (afl_id),
4649 KEY (afl_filter),

Comments

#Comment by Werdna (talk | contribs)   21:38, 14 June 2009

Presently there is not support for activating this on Wikimedia.

I tried to get the people on meta to agree with it, but they didn't, so this shouldn't be a scaptrap.

#Comment by Dferg (talk | contribs)   09:13, 23 July 2011

Not sure what is a "scaptrap" (sorry) :) but this is presently very needed to stop some pattern vandals across the wikis. A discussion can be started if needed but a feature like this will help us a lot stopping some cross-wiki vandals or difficulting him vandalizing). Thanks for creating this, tho. Regards.

#Comment by P858snake (talk | contribs)   09:16, 23 July 2011

Yes, consensus would need to be gained for this to be rolled out and activated.

#Comment by Platonides (talk | contribs)   21:51, 19 May 2012
if ($wgAbuseFilterCentralDB && !$wgAbuseFilterIsCentral) {

Shouldn't the $wgAbuseFilterIsCentral check be reversed?

Status & tagging log