Manual:Hooks/UserLoadFromSession

Details

 * $user: user object being loaded
 * &$result: set this to a boolean value to abort the normal authentication process

This hook replaces AutoAuthenticate, which has been removed in 1.13.

An extension can use this hook to fill in the data of the object $user from an external session. This is typically used in Authentication extensions.

When the authentication should continue undisturbed after the hook was executed, do not touch $result. When the normal authentication should not happen (e.g., because $user is completely initialized), set $result to any boolean value.

In any case, return.

See the talk page for sample code for this hook.

Deprecated
This hook has been deprecated in MediaWiki 1.27. Extensions should implement their own instead (or, in some cases, use the  and  hooks). See SessionManager and AuthManager#As a provider for more details.