diff options
Diffstat (limited to 'extensions/TitleBlacklist/TitleBlacklist.php')
-rw-r--r-- | extensions/TitleBlacklist/TitleBlacklist.php | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/extensions/TitleBlacklist/TitleBlacklist.php b/extensions/TitleBlacklist/TitleBlacklist.php index 68fb6778..7b5c67d2 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.php +++ b/extensions/TitleBlacklist/TitleBlacklist.php @@ -13,15 +13,17 @@ $wgExtensionCredits['antispam'][] = array( 'path' => __FILE__, 'name' => 'Title Blacklist', 'author' => array( 'Victor Vasiliev', 'Fran Rogers' ), - 'version' => '1.4.2', + 'version' => '1.5.0', 'url' => 'https://www.mediawiki.org/wiki/Extension:Title_Blacklist', 'descriptionmsg' => 'titleblacklist-desc', ); $dir = __DIR__; +$wgMessagesDirs['TitleBlacklist'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['TitleBlacklist'] = $dir . '/TitleBlacklist.i18n.php'; $wgAutoloadClasses['TitleBlacklist'] = $dir . '/TitleBlacklist.list.php'; $wgAutoloadClasses['TitleBlacklistHooks'] = $dir . '/TitleBlacklist.hooks.php'; +$wgAutoloadClasses['Scribunto_LuaTitleBlacklistLibrary'] = $dir . '/TitleBlacklist.library.php'; /** @defgroup Title blacklist source types * @{ @@ -52,6 +54,11 @@ $wgTitleBlacklistSources = array(); */ $wgTitleBlacklistUsernameSources = '*'; +/** + * Log blacklist hits to Special:Log + */ +$wgTitleBlacklistLogHits = false; + $wgTitleBlacklistCaching = array( 'warningchance' => 100, 'expiry' => 900, @@ -69,13 +76,29 @@ $wgAvailableRights[] = 'tboverride-account'; // For account creation $wgGroupPermissions['sysop']['tboverride'] = true; $wgHooks['getUserPermissionsErrorsExpensive'][] = 'TitleBlacklistHooks::userCan'; +$wgHooks['TitleGetEditNotices'][] = 'TitleBlacklistHooks::displayBlacklistOverrideNotice'; $wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove'; $wgHooks['AbortNewAccount'][] = 'TitleBlacklistHooks::abortNewAccount'; $wgHooks['AbortAutoAccount'][] = 'TitleBlacklistHooks::abortNewAccount'; -$wgHooks['CentralAuthAutoCreate'][] = 'TitleBlacklistHooks::centralAuthAutoCreate'; $wgHooks['EditFilter'][] = 'TitleBlacklistHooks::validateBlacklist'; $wgHooks['ArticleSaveComplete'][] = 'TitleBlacklistHooks::clearBlacklist'; $wgHooks['UserCreateForm'][] = 'TitleBlacklistHooks::addOverrideCheckbox'; +$wgHooks['UnitTestsList'][] = function( &$files ) { + $files += glob( __DIR__ . '/tests/*Test.php' ); + return true; +}; +$wgHooks['ScribuntoExternalLibraries'][] = function( $engine, array &$extraLibraries ) { + if( $engine == 'lua' ) { + $extraLibraries['mw.ext.TitleBlacklist'] = 'Scribunto_LuaTitleBlacklistLibrary'; + } + return true; +}; + +$wgLogTypes[] = 'titleblacklist'; +$wgLogActionsHandlers['titleblacklist/*'] = 'LogFormatter'; +$wgLogRestrictions['titleblacklist'] = 'titleblacklistlog'; +$wgGroupPermissions['sysop']['titleblacklistlog'] = true; +$wgAvailableRights[] = 'titleblacklistlog'; $wgResourceModules['mediawiki.api.titleblacklist'] = array( 'scripts' => 'mediawiki.api.titleblacklist.js', |