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";
|
2009-01-28 00:10:35 +00:00
|
|
|
$wgAutoloadClasses['AbuseFilterViewRevert'] = "$dir/Views/AbuseFilterViewRevert.php";
|
2009-01-28 23:54:41 +00:00
|
|
|
$wgAutoloadClasses['AbuseFilterViewTest'] = "$dir/Views/AbuseFilterViewTest.php";
|
2009-01-23 19:23:19 +00:00
|
|
|
|
2008-06-27 06:18:51 +00:00
|
|
|
$wgSpecialPages['AbuseLog'] = 'SpecialAbuseLog';
|
|
|
|
$wgSpecialPages['AbuseFilter'] = 'SpecialAbuseFilter';
|
2009-01-28 10:38:58 +00:00
|
|
|
$wgSpecialPageGroups['AbuseLog'] = 'changes';
|
|
|
|
$wgSpecialPageGroups['AbuseFilter'] = 'wiki';
|
2008-06-27 06:18:51 +00:00
|
|
|
|
|
|
|
$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-28 19:08:18 +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-27 19:51:38 +00:00
|
|
|
$wgAvailableRights[] = 'abusefilter-modify-restricted';
|
2009-01-28 00:10:35 +00:00
|
|
|
$wgAvailableRights[] = 'abusefilter-revert';
|
2008-06-27 06:18:51 +00:00
|
|
|
|
2009-01-28 19:08:18 +00:00
|
|
|
$wgAbuseFilterAvailableActions = array( 'flag', 'throttle', 'warn', 'disallow', 'blockautopromote', 'block', 'degroup', 'tag' );
|
2008-07-17 02:43:45 +00:00
|
|
|
|
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-28 23:54:41 +00:00
|
|
|
$wgAjaxExportList[] = 'AbuseFilter::ajaxGetFilter';
|
2009-01-15 19:04:36 +00:00
|
|
|
|
2009-01-27 17:32:30 +00:00
|
|
|
// Bump the version number every time you change any of the .css/.js files
|
2009-01-28 19:40:15 +00:00
|
|
|
$wgAbuseFilterStyleVersion = 3;
|
2009-01-27 19:51:38 +00:00
|
|
|
|
|
|
|
$wgAbuseFilterRestrictedActions = array( 'block', 'degroup' );
|
2009-01-27 20:18:58 +00:00
|
|
|
|