diff --git a/api/src/Accounts.php b/api/src/Accounts.php index 3ec5d880c4..2f5a5bccee 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -1191,6 +1191,12 @@ class Accounts { $memberships[] = $primary_group; } + // add a requested addtional group, eg. Teachers for smallpart + if (!empty($GLOBALS['auto_create_acct']['add_group']) && + $this->get_type((int)$GLOBALS['auto_create_acct']['add_group']) === 'g') + { + $memberships[] = (int)$GLOBALS['auto_create_acct']['add_group']; + } $data = array( 'account_lid' => $account_lid, 'account_type' => 'u', diff --git a/api/src/Auth/Saml.php b/api/src/Auth/Saml.php index 9230612dc0..b407efd6c7 100644 --- a/api/src/Auth/Saml.php +++ b/api/src/Auth/Saml.php @@ -555,9 +555,9 @@ class Saml implements BackendSSO // check if affiliation is configured and attribute returned by IdP $attr = $config['saml_affiliation'] === 'eduPersonAffiliation' ? self::eduPersonAffiliation : $config['saml_affiliation_oid']; if (!empty($attr) && !empty($attrs[$attr]) && !empty($config['saml_affiliation_group']) && !empty($config['saml_affiliation_values']) && - ($gid = $GLOBALS['egw']->accounts->name2id($config['saml_affiliation_group'], 'account_id', 'g'))) + ($gid = $GLOBALS['egw']->accounts->name2id($config['saml_affiliation_group'], 'account_lid', 'g'))) { - if (!isset($auto_create_acct) && ($accout_id = $GLOBALS['egw']->accounts->name2id($username, 'account_id', 'u'))) + if (!isset($auto_create_acct) && ($accout_id = $GLOBALS['egw']->accounts->name2id($username, 'account_lid', 'u'))) { $memberships = $GLOBALS['egw']->accounts->memberships($accout_id, true); }