X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fauth%2FAuthManager.php;h=611a8cdc3a7b93da122e39dd3e9eeaced1190852;hp=af070c25cbbd064f5f6a8a5cb0c95a117abcda50;hb=e62a8361d75344ab15e8def60cb7f2c6c4db2adb;hpb=153ad6a2c8610df3d9763fd2e1bb67d345c10231 diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index af070c25cb..611a8cdc3a 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. @@ -680,8 +681,9 @@ class AuthManager implements LoggerAwareInterface { // Step 4: Authentication complete! Set the user in the session and // clean up. - $this->logger->info( 'Login for {user} succeeded', [ + $this->logger->info( 'Login for {user} succeeded from {clientip}', [ 'user' => $user->getName(), + 'clientip' => $this->request->getIP(), ] ); /** @var RememberMeAuthenticationRequest $req */ $req = AuthenticationRequest::getRequestByClass( @@ -1415,7 +1417,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 ); @@ -1729,7 +1731,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 ); @@ -2292,7 +2294,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 )