X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcreateAndPromote.php;h=93614e0a77b7cd1f4cee30907e9ae67f712682df;hb=befe7d531442335119552aaa56455651eccbc79f;hp=24ab3d21fc72a1cb8c1e7b3e86365b63e5c5c105;hpb=bd7886961820d5f369029a007c6a75866fde5f19;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index 24ab3d21fc..93614e0a77 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -112,9 +112,16 @@ class CreateAndPromote extends Maintenance { } if ( !$exists ) { - # Insert the account into the database - $user->addToDatabase(); - $user->saveSettings(); + // Create the user via AuthManager as there may be various side + // effects that are perfomed by the configured AuthManager chain. + $status = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser( + $user, + MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_MAINT, + false + ); + if ( !$status->isGood() ) { + $this->fatalError( $status->getWikiText( null, null, 'en' ) ); + } } if ( $password ) {