Pgehres has uploaded a new change for review.
https://gerrit.wikimedia.org/r/60686
Change subject: DO NOT SUBMIT: Block creation of clashing local accounts
......................................................................
DO NOT SUBMIT: Block creation of clashing local accounts
Blocks the creation of new local accounts with usernames that clash with
lcoal accounts on other wikis, but for which no gloabl account exists.
Change-Id: I79ba1445740f8d4b831088a09c9918b6f2b8f904
---
M CentralAuth.php
M CentralAuthHooks.php
2 files changed, 12 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth
refs/changes/86/60686/1
diff --git a/CentralAuth.php b/CentralAuth.php
index bfd06d9..ff105a8 100644
--- a/CentralAuth.php
+++ b/CentralAuth.php
@@ -148,6 +148,13 @@
$wgCentralAuthReadOnly = false;
/**
+ * Disallow the creation of new local accounts that clash with a local account
+ * on another wiki, even if there is no global account with that name.
+ * @var bool
+ */
+$wgCentralAuthAbortNewClashingLocal = false;
+
+/**
* Initialization of the autoloaders, and special extension pages.
*/
$caBase = __DIR__;
diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 3733186..14c7e72 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -105,8 +105,12 @@
* @return bool
*/
static function onAbortNewAccount( $user, &$abortError ) {
+ global $wgCentralAuthAbortNewClashingLocal;
$centralUser = CentralAuthUser::getInstance( $user );
- if ( $centralUser->exists() ) {
+ if (
+ $centralUser->exists() ||
+ ( $wgCentralAuthAbortNewClashingLocal && count(
$centralUser->queryUnattached() ) > 0 )
+ ) {
$abortError = wfMessage( 'centralauth-account-exists'
)->text();
return false;
}
--
To view, visit https://gerrit.wikimedia.org/r/60686
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I79ba1445740f8d4b831088a09c9918b6f2b8f904
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits