This avoids a race in CentralAuth:
* The user doesn't exist locally, so CA wants to create it
* Auto-creation adds the user to the database
* A hook function tries to access the session; now the user does exist
locally but isn't yet attached, so CA rejects the session.
Bug: T125283
Change-Id: I6024885e3cf9c85c527fc160577f66ff97451c98
// @codeCoverageIgnoreEnd
}
// @codeCoverageIgnoreEnd
}
- # Notify hooks (e.g. Newuserlog)
- \Hooks::run( 'AuthPluginAutoCreate', array( $user ) );
- \Hooks::run( 'LocalUserCreated', array( $user, true ) );
-
- # Notify AuthPlugin too
$tmpUser = $user;
$wgAuth->initUser( $tmpUser, true );
if ( $tmpUser !== $user ) {
$tmpUser = $user;
$wgAuth->initUser( $tmpUser, true );
if ( $tmpUser !== $user ) {
get_class( $wgAuth ) . '::initUser() replaced the user object' );
}
get_class( $wgAuth ) . '::initUser() replaced the user object' );
}
+ # Notify hooks (e.g. Newuserlog)
+ \Hooks::run( 'AuthPluginAutoCreate', array( $user ) );
+ \Hooks::run( 'LocalUserCreated', array( $user, true ) );
+
$user->saveSettings();
# Update user count
$user->saveSettings();
# Update user count