Manual:Hooks/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.php, auth/AuthManager.php
Interface: UserLoggedInHook.php

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


Details edit

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

Notes edit

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 edit