2007-11-05 16:38:38 +00:00
|
|
|
<?php
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
*/
|
|
|
|
|
2010-12-20 04:05:54 +00:00
|
|
|
$wgExtensionCredits[version_compare($wgVersion, '1.17alpha', '>=') ? 'antispam' : 'other'][] = array(
|
2009-04-27 04:45:10 +00:00
|
|
|
'path' => __FILE__,
|
2008-02-18 20:43:36 +00:00
|
|
|
'name' => 'Title Blacklist',
|
2010-11-08 21:55:05 +00:00
|
|
|
'author' => array( 'Victor Vasiliev', 'Fran Rogers' ),
|
2008-08-09 01:54:39 +00:00
|
|
|
'version' => '1.4.2',
|
2008-02-18 20:43:36 +00:00
|
|
|
'url' => 'http://www.mediawiki.org/wiki/Extension:Title_Blacklist',
|
|
|
|
'descriptionmsg' => 'titleblacklist-desc',
|
2007-11-05 16:38:38 +00:00
|
|
|
);
|
|
|
|
|
2008-11-30 03:15:22 +00:00
|
|
|
$wgExtensionMessagesFiles['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.i18n.php';
|
|
|
|
$wgAutoloadClasses['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.list.php';
|
|
|
|
$wgAutoloadClasses['TitleBlacklistHooks'] = dirname( __FILE__ ) . '/TitleBlacklist.hooks.php';
|
2007-12-08 21:06:21 +00:00
|
|
|
|
2008-08-09 01:54:39 +00:00
|
|
|
/** @defgroup Title blacklist source types
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
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
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** Array of title blacklist sources */
|
2007-12-09 12:15:13 +00:00
|
|
|
$wgTitleBlacklistSources = array();
|
2007-11-05 16:38:38 +00:00
|
|
|
|
2007-12-19 18:35:44 +00:00
|
|
|
$wgTitleBlacklistCaching = array(
|
|
|
|
'warningchance' => 100,
|
|
|
|
'expiry' => 900,
|
|
|
|
'warningexpiry' => 600,
|
|
|
|
);
|
|
|
|
|
2010-11-08 21:55:05 +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';
|
2008-06-11 21:02:36 +00:00
|
|
|
|
2008-08-09 01:54:39 +00:00
|
|
|
/**
|
|
|
|
* Initialize the title blacklist
|
|
|
|
*/
|
2007-12-08 21:06:21 +00:00
|
|
|
function efInitTitleBlacklist() {
|
|
|
|
global $wgTitleBlacklist;
|
2011-03-17 22:20:01 +00:00
|
|
|
if( isset( $wgTitleBlacklist ) && $wgTitleBlacklist ) {
|
|
|
|
return;
|
|
|
|
}
|
2007-12-08 21:06:21 +00:00
|
|
|
$wgTitleBlacklist = new TitleBlacklist();
|
|
|
|
}
|
2008-08-09 01:54:39 +00:00
|
|
|
|
|
|
|
//@}
|