mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix warning
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user