fix typo and missing Accounts.php

This commit is contained in:
Ralf Becker 2020-10-30 13:02:06 +01:00
parent ba8cd17816
commit 47c8897642
2 changed files with 8 additions and 2 deletions

View File

@ -1218,6 +1218,12 @@ class Accounts
{ {
$memberships[] = $primary_group; $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( $data = array(
'account_lid' => $account_lid, 'account_lid' => $account_lid,
'account_type' => 'u', 'account_type' => 'u',

View File

@ -555,9 +555,9 @@ class Saml implements BackendSSO
// check if affiliation is configured and attribute returned by IdP // check if affiliation is configured and attribute returned by IdP
$attr = $config['saml_affiliation'] === 'eduPersonAffiliation' ? self::eduPersonAffiliation : $config['saml_affiliation_oid']; $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']) && 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); $memberships = $GLOBALS['egw']->accounts->memberships($accout_id, true);
} }