Skip to content

Commit

Permalink
mapping in config
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtificialOwl authored and AndyScherzinger committed May 9, 2024
1 parent 3f26043 commit 9e19e04
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,17 @@ public function updateAttributes($uid,

if ($newGroups !== null) {
$prefix = '';
if ($this->config->getAppValue('user_saml', 'unique_groups_per_idp', '0') === '1') {
list(, $idp) = explode('@', $uid);
$mapping = $this->config->getSystemValue('user_saml.unique_groups_per_idp', '');
if ($mapping === '') {
$mapping = $this->config->getAppValue('user_saml', 'unique_groups_per_idp', '');
}

if ($mapping !== '' &&
array_key_exists($mapping, $attributes) &&
is_array($attributes[$mapping]) &&
sizeof($attributes[$mapping]) === 1) {
$realUid = $attributes[$mapping][0];
list(, $idp) = explode('@', $realUid);
$prefix = substr(md5($idp), 0, 7);
$newGroups = array_map(
function($g) use ($prefix) {
Expand Down

0 comments on commit 9e19e04

Please sign in to comment.