From 3f78cb096d0db150db2705936f1d46dc1c74e8df Mon Sep 17 00:00:00 2001 From: northway Date: Sat, 21 Sep 2019 20:15:10 +0200 Subject: [PATCH] Bugfix: GroupMap for new users --- README.md | 4 ---- Shibboleth.class.php | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6f87134..9b367d3 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,3 @@ Shibboleth Single Logout (SLO) URL structure `$wgShibboleth_Logout_Base_Url . Shibboleth.sso/Logout?return= . $wgShibboleth_Logout_Target_Url` `https://wiki.example.org/Shibboleth.sso/Logout?return=https://wiki.example.org/index.php` - -## Known Bugs - -The very first time when the user authenticates with Shibboleth, **$wgShibboleth_GroupMap** does not take effect due [T184736](https://phabricator.wikimedia.org/T184736) bug. It requires a relogin (logout then login) to be able to map the given configuration. diff --git a/Shibboleth.class.php b/Shibboleth.class.php index 797f3e4..d99cb3b 100644 --- a/Shibboleth.class.php +++ b/Shibboleth.class.php @@ -30,6 +30,13 @@ public function authenticate(&$id, &$username, &$realname, &$email, &$errorMessa $this->checkGroupMap(); } + $user = User::newFromName($username); + $temporaryUserId = $user->getId(); + + if ($temporaryUserId !== 0) { + $id = $mId; + } + return true; }