diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php index 969d261e..40466ea8 100644 --- a/TitleBlacklist.hooks.php +++ b/TitleBlacklist.hooks.php @@ -163,6 +163,8 @@ class TitleBlacklistHooks { * AbortNewAccount hook * * @param User $user + * @param string &$message + * @return bool */ public static function abortNewAccount( $user, &$message ) { global $wgUser, $wgRequest; @@ -170,6 +172,21 @@ class TitleBlacklistHooks { return self::acceptNewUserName( $user->getName(), $wgUser, $message, $override, true ); } + /** + * AbortAutoAccount hook + * + * @param User $user + * @param string &$message + * @return bool + */ + public static function abortAutoAccount( $user, &$message ) { + global $wgTitleBlacklistBlockAutoAccountCreation; + if ( $wgTitleBlacklistBlockAutoAccountCreation ) { + return self::abortNewAccount( $user, $message ); + } + return true; + } + /** * EditFilter hook * diff --git a/extension.json b/extension.json index ec060001..e5b9ed69 100644 --- a/extension.json +++ b/extension.json @@ -73,7 +73,7 @@ "TitleBlacklistHooks::abortNewAccount" ], "AbortAutoAccount": [ - "TitleBlacklistHooks::abortNewAccount" + "TitleBlacklistHooks::abortAutoAccount" ], "EditFilter": [ "TitleBlacklistHooks::validateBlacklist" @@ -99,7 +99,8 @@ "warningchance": 100, "expiry": 900, "warningexpiry": 600 - } + }, + "TitleBlacklistBlockAutoAccountCreation": true }, "manifest_version": 1 }