Page MenuHomePhabricator

Run hook `UserLoggedIn`
Closed, ResolvedPublic

Description

Mediawiki's SessionManager doesn't fire this hook, because it is getting called by the AuthManager only. And it happens in two places. First when processing all AuthenticationProviders (@see setSessionDataForUser in core file include/auth/AuthManager.php). Second when creating a new user automatically (@see autoCreateUser in include/auth/AuthManager.php).

But this Auth_remoteuser extension is a SessionProvider. And only the second case (automatic user creation) can be triggered by us. The first case is missing, because we do not authenticate a user (this is done by our remote authentication source), hence do not running through Mediawiki's AuthManager auth stack.

We should call this hook explicitely when we created a new session for an already known user (because Mediawiki core doesn't do that for us).

Revisions and Commits

Related Objects

Event Timeline

Is this commit in Gerrit somewhere?

Change 383845 had a related patch set uploaded (by Zoranzoki21; owner: Robert Vogel):
[mediawiki/extensions/Auth_remoteuser@master] Firing hook 'UserLoggedIn'

https://gerrit.wikimedia.org/r/383845

Change 383845 merged by jenkins-bot:
[mediawiki/extensions/Auth_remoteuser@master] Firing hook 'UserLoggedIn'

https://gerrit.wikimedia.org/r/383845

Enst80 claimed this task.

Thank you all. New version 2.0.1 released (annotated tag also).