From f640d403154bc0a2b4f6d399582797a9e3bc6fcb Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 21 Jan 2016 15:20:44 -0500 Subject: [PATCH] SessionManager: Notify AuthPlugin when auto-creating accounts Bug: T74791 Change-Id: Iabb44d58a922051ca2d70a052d6c53734a4f8936 --- includes/session/SessionManager.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index 0e4546885a..c4f33d05c3 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -496,6 +496,16 @@ final class SessionManager implements SessionManagerInterface { \Hooks::run( 'AuthPluginAutoCreate', array( $user ) ); \Hooks::run( 'LocalUserCreated', array( $user, true ) ); + # Notify AuthPlugin too + $tmpUser = $user; + $wgAuth->initUser( $tmpUser, true ); + if ( $tmpUser !== $user ) { + $logger->warning( __METHOD__ . ': ' . + get_class( $wgAuth ) . '::initUser() replaced the user object' ); + } + + $user->saveSettings(); + # Update user count \DeferredUpdates::addUpdate( new \SiteStatsUpdate( 0, 0, 0, 0, 1 ) ); -- 2.20.1