X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fauth%2FAuthManager.php;h=9ed6d13a2625450ee5ec3b475b008a41ec147c18;hb=28734f84f7283449bf18e50b6f2b2d091495e433;hp=b2528fe69322c85d66749e63cbb38a3e20235113;hpb=19a84db108b86f8d4b94bde8e9c34add9f13cc31;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index b2528fe693..9ed6d13a26 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -31,6 +31,7 @@ use Status; use StatusValue; use User; use WebRequest; +use Wikimedia\ObjectFactory; /** * This serves as the entry point to the authentication system. @@ -975,7 +976,7 @@ class AuthManager implements LoggerAwareInterface { public function checkAccountCreatePermissions( User $creator ) { // Wiki is read-only? if ( wfReadOnly() ) { - return Status::newFatal( 'readonlytext', wfReadOnlyReason() ); + return Status::newFatal( wfMessage( 'readonlytext', wfReadOnlyReason() ) ); } // This is awful, this permission check really shouldn't go through Title. @@ -1415,7 +1416,7 @@ class AuthManager implements LoggerAwareInterface { $state['userid'] = $user->getId(); // Update user count - \DeferredUpdates::addUpdate( new \SiteStatsUpdate( 0, 0, 0, 0, 1 ) ); + \DeferredUpdates::addUpdate( \SiteStatsUpdate::factory( [ 'users' => 1 ] ) ); // Watch user's userpage and talk page $user->addWatch( $user->getUserPage(), User::IGNORE_USER_RIGHTS ); @@ -1551,7 +1552,10 @@ class AuthManager implements LoggerAwareInterface { // Fetch the user ID from the master, so that we don't try to create the user // when they already exist, due to replication lag // @codeCoverageIgnoreStart - if ( !$localId && wfGetLB()->getReaderIndex() != 0 ) { + if ( + !$localId && + MediaWikiServices::getInstance()->getDBLoadBalancer()->getReaderIndex() != 0 + ) { $localId = User::idFromName( $username, User::READ_LATEST ); $flags = User::READ_LATEST; } @@ -1579,7 +1583,7 @@ class AuthManager implements LoggerAwareInterface { ] ); $user->setId( 0 ); $user->loadFromId(); - return Status::newFatal( 'readonlytext', wfReadOnlyReason() ); + return Status::newFatal( wfMessage( 'readonlytext', wfReadOnlyReason() ) ); } // Check the session, if we tried to create this user already there's @@ -1726,7 +1730,7 @@ class AuthManager implements LoggerAwareInterface { $user->saveSettings(); // Update user count - \DeferredUpdates::addUpdate( new \SiteStatsUpdate( 0, 0, 0, 0, 1 ) ); + \DeferredUpdates::addUpdate( \SiteStatsUpdate::factory( [ 'users' => 1 ] ) ); // Watch user's userpage and talk page \DeferredUpdates::addCallableUpdate( function () use ( $user ) { $user->addWatch( $user->getUserPage(), User::IGNORE_USER_RIGHTS ); @@ -2289,7 +2293,7 @@ class AuthManager implements LoggerAwareInterface { $ret = []; foreach ( $specs as $spec ) { - $provider = \ObjectFactory::getObjectFromSpec( $spec ); + $provider = ObjectFactory::getObjectFromSpec( $spec ); if ( !$provider instanceof $class ) { throw new \RuntimeException( "Expected instance of $class, got " . get_class( $provider )