2008-06-27 06:18:51 +00:00
< ? php
if ( ! defined ( 'MEDIAWIKI' ) )
die ();
/** #@+
* Automatically applies heuristics to edits .
* @ addtogroup Extensions
*
* @ link http :// www . mediawiki . org / wiki / Extension : AbuseFilter Documentation
*
*
* @ author Andrew Garrett < andrew @ epstone . net >
* @ license http :// www . gnu . org / copyleft / gpl . html GNU General Public License 2.0 or later
*/
$dir = dirname ( __FILE__ );
$wgExtensionCredits [ 'other' ][] = array (
'name' => 'Abuse Filter' ,
2008-08-11 05:57:17 +00:00
'author' => array ( 'Andrew Garrett' , 'River Tarnell' ),
2008-06-27 06:18:51 +00:00
'svn-date' => '$LastChangedDate: 2008-06-08 20:48:19 +1000 (Sun, 08 Jun 2008) $' ,
'svn-revision' => '$LastChangedRevision: 36018 $' ,
'description' => 'Applies automatic heuristics to edits.' ,
'descriptionmsg' => 'abusefilter-desc' ,
'url' => 'http://www.mediawiki.org/wiki/Extension:AbuseFilter' ,
);
$wgExtensionMessagesFiles [ 'AbuseFilter' ] = " $dir /AbuseFilter.i18n.php " ;
2008-08-07 23:29:59 +00:00
$wgExtensionAliasesFiles [ 'AbuseFilter' ] = " $dir /AbuseFilter.alias.php " ;
2008-06-27 06:18:51 +00:00
2008-09-18 13:01:50 +00:00
$wgAutoloadClasses [ 'AbuseFilter' ] = " $dir /AbuseFilter.class.php " ;
$wgAutoloadClasses [ 'AbuseFilterParser' ] = " $dir /AbuseFilter.parser.php " ;
$wgAutoloadClasses [ 'AbuseFilterHooks' ] = " $dir /AbuseFilter.hooks.php " ;
2008-06-27 06:18:51 +00:00
$wgAutoloadClasses [ 'SpecialAbuseLog' ] = " $dir /SpecialAbuseLog.php " ;
$wgAutoloadClasses [ 'SpecialAbuseFilter' ] = " $dir /SpecialAbuseFilter.php " ;
2009-01-23 19:23:19 +00:00
$wgAutoloadClasses [ 'AbuseFilterViewList' ] = " $dir /Views/AbuseFilterViewList.php " ;
$wgAutoloadClasses [ 'AbuseFilterView' ] = " $dir /Views/AbuseFilterView.php " ;
$wgAutoloadClasses [ 'AbuseFilterViewEdit' ] = " $dir /Views/AbuseFilterViewEdit.php " ;
$wgAutoloadClasses [ 'AbuseFilterViewTools' ] = " $dir /Views/AbuseFilterViewTools.php " ;
$wgAutoloadClasses [ 'AbuseFilterViewHistory' ] = " $dir /Views/AbuseFilterViewHistory.php " ;
2008-06-27 06:18:51 +00:00
$wgSpecialPages [ 'AbuseLog' ] = 'SpecialAbuseLog' ;
$wgSpecialPages [ 'AbuseFilter' ] = 'SpecialAbuseFilter' ;
$wgHooks [ 'EditFilter' ][] = 'AbuseFilterHooks::onEditFilter' ;
$wgHooks [ 'GetAutoPromoteGroups' ][] = 'AbuseFilterHooks::onGetAutoPromoteGroups' ;
$wgHooks [ 'AbortMove' ][] = 'AbuseFilterHooks::onAbortMove' ;
$wgHooks [ 'AbortNewAccount' ][] = 'AbuseFilterHooks::onAbortNewAccount' ;
$wgHooks [ 'ArticleDelete' ][] = 'AbuseFilterHooks::onArticleDelete' ;
2008-09-05 14:27:18 +00:00
$wgHooks [ 'LoadExtensionSchemaUpdates' ][] = 'AbuseFilterHooks::onSchemaUpdate' ;
2008-09-18 13:33:39 +00:00
$wgHooks [ 'AbortDeleteQueueNominate' ][] = 'AbuseFilterHooks::onAbortDeleteQueueNominate' ;
2009-01-23 19:23:44 +00:00
// $wgHooks['RecentChange_save'][] = 'AbuseFilterHooks::onRecentChangeSave';
// $wgHooks['ListDefinedTags'][] = 'AbuseFilterHooks::onListDefinedTags';
2008-06-27 06:18:51 +00:00
$wgAvailableRights [] = 'abusefilter-modify' ;
$wgAvailableRights [] = 'abusefilter-log-detail' ;
$wgAvailableRights [] = 'abusefilter-view' ;
$wgAvailableRights [] = 'abusefilter-log' ;
$wgAvailableRights [] = 'abusefilter-private' ;
2009-01-23 19:23:44 +00:00
$wgAbuseFilterAvailableActions = array ( 'flag' , 'throttle' , 'warn' , 'disallow' , 'blockautopromote' , 'block' , 'degroup' , 'rangeblock' /*, 'tag' Disabled for now to avoid trunk changes. */ );
2008-07-17 02:43:45 +00:00
// Conditions take about 4ms to check, so 100 conditions would take 400ms
2008-09-22 06:28:07 +00:00
// Currently, has no effect.
2009-01-23 19:23:19 +00:00
$wgAbuseFilterConditionLimit = 1000 ;
2008-07-17 02:43:45 +00:00
2008-09-18 13:01:50 +00:00
// Disable filters if they match more than X edits, constituting more than Y% of the last Z edits, if they have been changed in the last S seconds
2008-09-22 14:40:57 +00:00
$wgAbuseFilterEmergencyDisableThreshold = 0.05 ;
2008-09-18 13:01:50 +00:00
$wgAbuseFilterEmergencyDisableCount = 2 ;
$wgAbuseFilterEmergencyDisableAge = 86400 ; // One day.
2008-07-31 16:28:24 +00:00
// Abuse filter parser class
2008-09-18 13:01:50 +00:00
$wgAbuseFilterParserClass = 'AbuseFilterParser' ;
2008-08-02 11:10:42 +00:00
$wgAbuseFilterNativeParser = " $dir /parser_native/af_parser " ;
2008-08-04 12:15:14 +00:00
$wgAbuseFilterNativeSyntaxCheck = " $dir /parser_native/syntax_check " ;
2008-08-04 14:27:48 +00:00
$wgAbuseFilterNativeExpressionEvaluator = " $dir /parser_native/af_expr " ;
2008-08-04 12:15:14 +00:00
2008-08-04 14:27:48 +00:00
$wgAjaxExportList [] = 'AbuseFilter::ajaxCheckSyntax' ;
2008-09-29 13:30:11 +00:00
$wgAjaxExportList [] = 'AbuseFilter::ajaxEvaluateExpression' ;
2009-01-15 19:04:36 +00:00
$wgAjaxExportList [] = 'AbuseFilter::ajaxReAutoconfirm' ;
2009-01-27 17:32:30 +00:00
// Bump the version number every time you change any of the .css/.js files
$wgAbuseFilterStyleVersion = 2 ;