2007-11-05 16:38:38 +00:00
|
|
|
<?php
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
2012-08-29 13:53:38 +00:00
|
|
|
exit( 1 );
|
2007-11-05 16:38:38 +00:00
|
|
|
}
|
|
|
|
|
2012-08-29 13:53:38 +00:00
|
|
|
// @{
|
2008-08-09 01:54:39 +00:00
|
|
|
/**
|
2010-06-06 15:12:22 +00:00
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
2008-08-09 01:54:39 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-13 14:06:45 +00:00
|
|
|
$wgExtensionCredits['antispam'][] = array(
|
2009-04-27 04:45:10 +00:00
|
|
|
'path' => __FILE__,
|
2008-02-18 20:43:36 +00:00
|
|
|
'name' => 'Title Blacklist',
|
2013-02-19 03:52:32 +00:00
|
|
|
'author' => array( 'Victor Vasiliev', 'Fran Rogers' ),
|
2008-08-09 01:54:39 +00:00
|
|
|
'version' => '1.4.2',
|
2011-12-13 23:49:33 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:Title_Blacklist',
|
2008-02-18 20:43:36 +00:00
|
|
|
'descriptionmsg' => 'titleblacklist-desc',
|
2007-11-05 16:38:38 +00:00
|
|
|
);
|
|
|
|
|
2012-08-29 13:53:38 +00:00
|
|
|
$dir = __DIR__;
|
|
|
|
$wgExtensionMessagesFiles['TitleBlacklist'] = $dir . '/TitleBlacklist.i18n.php';
|
|
|
|
$wgAutoloadClasses['TitleBlacklist'] = $dir . '/TitleBlacklist.list.php';
|
|
|
|
$wgAutoloadClasses['TitleBlacklistHooks'] = $dir . '/TitleBlacklist.hooks.php';
|
2007-12-08 21:06:21 +00:00
|
|
|
|
2008-08-09 01:54:39 +00:00
|
|
|
/** @defgroup Title blacklist source types
|
|
|
|
* @{
|
|
|
|
*/
|
2012-08-29 13:53:38 +00:00
|
|
|
define( 'TBLSRC_MSG', 0 ); ///< For internal usage
|
|
|
|
define( 'TBLSRC_LOCALPAGE', 1 ); ///< Local wiki page
|
|
|
|
define( 'TBLSRC_URL', 2 ); ///< Load blacklist from URL
|
|
|
|
define( 'TBLSRC_FILE', 3 ); ///< Load from file
|
2008-08-09 01:54:39 +00:00
|
|
|
/** @} */
|
|
|
|
|
2012-05-24 23:55:22 +00:00
|
|
|
/**
|
|
|
|
* Array of title blacklist sources.
|
|
|
|
*
|
|
|
|
* Should be in array( name => source description ) format.
|
|
|
|
* See extension documentation for details of source description.
|
|
|
|
*/
|
2007-12-09 12:15:13 +00:00
|
|
|
$wgTitleBlacklistSources = array();
|
2007-11-05 16:38:38 +00:00
|
|
|
|
2012-05-24 23:55:22 +00:00
|
|
|
/**
|
|
|
|
* Sets the sources which may work as a username filter.
|
|
|
|
*
|
|
|
|
* '*' is for all; false disables all.
|
|
|
|
*
|
|
|
|
* If you want to limit it to particular sources, use
|
|
|
|
* array( source name 1, source name 2 ).
|
|
|
|
* This may be useful when you have shared account creation system
|
|
|
|
* in order to avoid blacklist fragmentation.
|
|
|
|
*/
|
|
|
|
$wgTitleBlacklistUsernameSources = '*';
|
|
|
|
|
2007-12-19 18:35:44 +00:00
|
|
|
$wgTitleBlacklistCaching = array(
|
|
|
|
'warningchance' => 100,
|
|
|
|
'expiry' => 900,
|
|
|
|
'warningexpiry' => 600,
|
|
|
|
);
|
|
|
|
|
2011-07-21 22:08:44 +00:00
|
|
|
$dir = dirname( __FILE__ );
|
|
|
|
|
|
|
|
// Register the API method
|
|
|
|
$wgAutoloadClasses['ApiQueryTitleBlacklist'] = "$dir/api/ApiQueryTitleBlacklist.php";
|
|
|
|
$wgAPIModules['titleblacklist'] = 'ApiQueryTitleBlacklist';
|
|
|
|
|
2012-08-29 13:53:38 +00:00
|
|
|
$wgAvailableRights[] = 'tboverride'; // Implies tboverride-account
|
|
|
|
$wgAvailableRights[] = 'tboverride-account'; // For account creation
|
2007-11-05 16:38:38 +00:00
|
|
|
$wgGroupPermissions['sysop']['tboverride'] = true;
|
|
|
|
|
2008-06-11 21:02:36 +00:00
|
|
|
$wgHooks['getUserPermissionsErrorsExpensive'][] = 'TitleBlacklistHooks::userCan';
|
|
|
|
$wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove';
|
2008-08-09 01:54:39 +00:00
|
|
|
$wgHooks['AbortNewAccount'][] = 'TitleBlacklistHooks::abortNewAccount';
|
2011-04-05 01:18:40 +00:00
|
|
|
$wgHooks['AbortAutoAccount'][] = 'TitleBlacklistHooks::abortNewAccount';
|
2010-06-04 13:36:29 +00:00
|
|
|
$wgHooks['CentralAuthAutoCreate'][] = 'TitleBlacklistHooks::centralAuthAutoCreate';
|
2008-06-11 21:02:36 +00:00
|
|
|
$wgHooks['EditFilter'][] = 'TitleBlacklistHooks::validateBlacklist';
|
|
|
|
$wgHooks['ArticleSaveComplete'][] = 'TitleBlacklistHooks::clearBlacklist';
|
2010-11-08 21:55:05 +00:00
|
|
|
$wgHooks['UserCreateForm'][] = 'TitleBlacklistHooks::addOverrideCheckbox';
|
2013-11-07 10:32:01 +00:00
|
|
|
$wgHooks['UnitTestsList'][] = function( &$files ) {
|
|
|
|
$files += glob( __DIR__ . '/tests/*Test.php' );
|
|
|
|
return true;
|
|
|
|
};
|
2008-06-11 21:02:36 +00:00
|
|
|
|
2013-03-03 22:56:35 +00:00
|
|
|
$wgResourceModules['mediawiki.api.titleblacklist'] = array(
|
|
|
|
'scripts' => 'mediawiki.api.titleblacklist.js',
|
|
|
|
'localBasePath' => $dir . '/modules',
|
|
|
|
'remoteExtPath' => 'TitleBlacklist/modules',
|
|
|
|
'dependencies' => array( 'mediawiki.api' ),
|
|
|
|
);
|
2012-08-29 13:53:38 +00:00
|
|
|
// @}
|