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
|
* AbortNewAccount hook
|
||||||
*
|
*
|
||||||
* @param User $user
|
* @param User $user
|
||||||
|
* @param string &$message
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function abortNewAccount( $user, &$message ) {
|
public static function abortNewAccount( $user, &$message ) {
|
||||||
global $wgUser, $wgRequest;
|
global $wgUser, $wgRequest;
|
||||||
|
@ -170,6 +172,21 @@ class TitleBlacklistHooks {
|
||||||
return self::acceptNewUserName( $user->getName(), $wgUser, $message, $override, true );
|
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
|
* EditFilter hook
|
||||||
*
|
*
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
"TitleBlacklistHooks::abortNewAccount"
|
"TitleBlacklistHooks::abortNewAccount"
|
||||||
],
|
],
|
||||||
"AbortAutoAccount": [
|
"AbortAutoAccount": [
|
||||||
"TitleBlacklistHooks::abortNewAccount"
|
"TitleBlacklistHooks::abortAutoAccount"
|
||||||
],
|
],
|
||||||
"EditFilter": [
|
"EditFilter": [
|
||||||
"TitleBlacklistHooks::validateBlacklist"
|
"TitleBlacklistHooks::validateBlacklist"
|
||||||
|
@ -99,7 +99,8 @@
|
||||||
"warningchance": 100,
|
"warningchance": 100,
|
||||||
"expiry": 900,
|
"expiry": 900,
|
||||||
"warningexpiry": 600
|
"warningexpiry": 600
|
||||||
}
|
},
|
||||||
|
"TitleBlacklistBlockAutoAccountCreation": true
|
||||||
},
|
},
|
||||||
"manifest_version": 1
|
"manifest_version": 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue