Open main menu

Manual:Hooks/UserLoggedIn

< Manual:Hooks
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": "MyExtensionHooks::onUserLoggedIn"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UserLoggedIn'][] = 'MyExtensionHooks::onUserLoggedIn';
Called from:File(s): AuthManager.php SpecialUserlogin.php, AuthManager.php

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

DetailsEdit

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

NotesEdit

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

See alsoEdit