mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-24 06:04:05 +00:00
Add config option to disable blocking auto account creations
Bug: T35429 Change-Id: I83a80ba1c9f23962a8df5e8478b30c8b6e00eb70
This commit is contained in:
parent
3fd8c88b0d
commit
e483b741af
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue