Manual:Hooks/UserLoggedIn

Category:MediaWiki hooks#UserLoggedIn Category:Hooks added in MediaWiki 1.26.0#UserLoggedIn
UserLoggedIn
Available from version 1.26.0 (Gerrit change 236043)
Called after a user is logged in
Define function:
public static function onUserLoggedIn( $user ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserLoggedIn": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserLoggedIn"
	}
}
Called from: File(s): specials/SpecialUserLogin.phpCategory:MediaWiki hooks included in SpecialUserLogin.php#UserLoggedIn, auth/AuthManager.phpCategory:MediaWiki hooks included in AuthManager.php#UserLoggedIn
Interface: UserLoggedInHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:UserLoggedIn extensions.

Details

  • $user: User object for the logged-in user

Notes

Added in MediaWiki 1.26 as part of the upcoming AuthManager system. Replaces the AuthPlugin::updateUser() method call.

If $wgAutoCreateTempUser is active, this hook is also called when a temporary account is automatically created for a logged-out user.

See also

Category:Hooks added in MediaWiki 1.26.0 Category:MediaWiki hooks Category:MediaWiki hooks included in AuthManager.php Category:MediaWiki hooks included in SpecialUserLogin.php