mediawiki-extensions-TitleB.../TitleBlacklist.php
Victor Vasiliev 3219bf6dcb Title blacklist:
* (bug 22141) Introduce a separate user right for overriding title blacklist on account creations only
* Some minor refactorings
2010-11-08 21:55:05 +00:00

65 lines
2.1 KiB
PHP

<?php
if ( !defined( 'MEDIAWIKI' ) ) {
exit(1);
}
//@{
/**
* @file
* @ingroup Extensions
*/
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'Title Blacklist',
'author' => array( 'Victor Vasiliev', 'Fran Rogers' ),
'version' => '1.4.2',
'url' => 'http://www.mediawiki.org/wiki/Extension:Title_Blacklist',
'descriptionmsg' => 'titleblacklist-desc',
);
$wgExtensionMessagesFiles['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.i18n.php';
$wgAutoloadClasses['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.list.php';
$wgAutoloadClasses['TitleBlacklistHooks'] = dirname( __FILE__ ) . '/TitleBlacklist.hooks.php';
/** @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 */
$wgTitleBlacklistSources = array();
$wgTitleBlacklistCaching = array(
'warningchance' => 100,
'expiry' => 900,
'warningexpiry' => 600,
);
$wgAvailableRights[] = 'tboverride'; // Implies tboverride-account
$wgAvailableRights[] = 'tboverride-account'; // For account creation
$wgGroupPermissions['sysop']['tboverride'] = true;
$wgHooks['getUserPermissionsErrorsExpensive'][] = 'TitleBlacklistHooks::userCan';
$wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove';
$wgHooks['AbortNewAccount'][] = 'TitleBlacklistHooks::abortNewAccount';
$wgHooks['CentralAuthAutoCreate'][] = 'TitleBlacklistHooks::centralAuthAutoCreate';
$wgHooks['EditFilter'][] = 'TitleBlacklistHooks::validateBlacklist';
$wgHooks['ArticleSaveComplete'][] = 'TitleBlacklistHooks::clearBlacklist';
$wgHooks['UserCreateForm'][] = 'TitleBlacklistHooks::addOverrideCheckbox';
/**
* Initialize the title blacklist
*/
function efInitTitleBlacklist() {
global $wgTitleBlacklist;
if( isset( $wgTitleBlacklist ) && $wgTitleBlacklist ) return;
$wgTitleBlacklist = new TitleBlacklist();
}
//@}