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',
|
|
|
|
'author' => 'Andrew Garrett',
|
|
|
|
'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
|
|
|
|
|
|
|
$wgAutoloadClasses[ 'AbuseFilter' ] = "$dir/AbuseFilter.class.php";
|
2008-07-29 11:03:26 +00:00
|
|
|
$wgAutoloadClasses[ 'AbuseFilterParser' ] = "$dir/AbuseFilter.parser.php";
|
2008-07-31 16:28:24 +00:00
|
|
|
$wgAutoloadClasses[ 'AbuseFilterParserNative' ] = "$dir/AbuseFilter.nativeparser.php";
|
2008-06-27 06:18:51 +00:00
|
|
|
$wgAutoloadClasses[ 'AbuseFilterHooks' ] = "$dir/AbuseFilter.hooks.php";
|
|
|
|
$wgAutoloadClasses['SpecialAbuseLog'] = "$dir/SpecialAbuseLog.php";
|
|
|
|
$wgAutoloadClasses['SpecialAbuseFilter'] = "$dir/SpecialAbuseFilter.php";
|
|
|
|
|
|
|
|
$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';
|
|
|
|
|
|
|
|
$wgAvailableRights[] = 'abusefilter-modify';
|
|
|
|
$wgAvailableRights[] = 'abusefilter-log-detail';
|
|
|
|
$wgAvailableRights[] = 'abusefilter-view';
|
|
|
|
$wgAvailableRights[] = 'abusefilter-log';
|
|
|
|
$wgAvailableRights[] = 'abusefilter-private';
|
|
|
|
|
2008-07-17 02:43:45 +00:00
|
|
|
$wgAbuseFilterAvailableActions = array( 'flag', 'throttle', 'warn', 'disallow', 'blockautopromote', 'block', 'degroup' );
|
|
|
|
|
|
|
|
// Conditions take about 4ms to check, so 100 conditions would take 400ms
|
2008-07-18 08:30:25 +00:00
|
|
|
$wgAbuseFilterConditionLimit = 1000;
|
2008-07-17 02:43:45 +00:00
|
|
|
|
|
|
|
// Disable filters if they match more than X edits, constituting more than Y% of the last Z edits
|
|
|
|
$wgAbuseFilterEmergencyDisableThreshold = 0.05;
|
2008-07-31 16:28:24 +00:00
|
|
|
$wgAbuseFilterEmergencyDisableCount = 5;
|
|
|
|
|
|
|
|
// Abuse filter parser class
|
|
|
|
$wgAbuseFilterParserClass = 'AbuseFilterParserNative';
|
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';
|
|
|
|
$wgAjaxExportList[] = 'AbuseFilter::ajaxEvaluateExpression';
|