Fix warning

This commit is contained in:
Laurent Destailleur
2022-12-31 13:23:09 +01:00
parent 15c05d9b7d
commit e977a95cc7
14 changed files with 31 additions and 29 deletions

View File

@@ -176,17 +176,17 @@ if ($result >= 0) {
// 1 - Association des utilisateurs du groupe LDAP au groupe Dolibarr
$userList = array();
$userIdList = array();
foreach ($ldapgroup[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] as $key => $userdn) {
if ($key === 'count') {
foreach ($ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS')] as $tmpkey => $userdn) {
if ($tmpkey === 'count') {
continue;
}
if (empty($userList[$userdn])) { // Récupération de l'utilisateur
// Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement
if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS === 'memberUid') {
if (getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS') === 'memberUid') {
$userKey = array($userdn);
} else { // Pour les autres schémas, les membres sont listés sous forme de DN complets
$userFilter = explode(',', $userdn);
$userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS);
$userKey = $ldap->getAttributeValues('('.$userFilter[0].')', getDolGlobalString('LDAP_KEY_USERS'));
}
if (!is_array($userKey)) {
continue;
@@ -194,9 +194,9 @@ if ($result >= 0) {
$fuser = new User($db);
if ($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) {
if (getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_SID')) {
$fuser->fetch('', '', $userKey[0]); // Chargement du user concerné par le SID
} elseif ($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) {
} elseif (getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_LOGIN')) {
$fuser->fetch('', $userKey[0]); // Chargement du user concerné par le login
}