Merge pull request #17617 from piernov/11.0-fix-LDAPposixGroupId
Fix: properly set gid for Group LDAP synchro
This commit is contained in:
commit
6a2afabcac
@ -282,8 +282,8 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
$info=$object->_load_ldap_info();
|
||||
$dn=$object->_load_ldap_dn($info);
|
||||
|
||||
// Get a gid number for objectclass PosixGroup
|
||||
if (in_array('posixGroup', $info['objectclass'])) {
|
||||
// Get a gid number for objectclass PosixGroup if none was provided
|
||||
if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
|
||||
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
|
||||
}
|
||||
|
||||
|
||||
@ -983,7 +983,7 @@ class UserGroup extends CommonObject
|
||||
}
|
||||
$info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:'');
|
||||
}
|
||||
if(!empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID])){
|
||||
if(!empty($conf->global->LDAP_GROUP_FIELD_GROUPID)){
|
||||
$info[$conf->global->LDAP_GROUP_FIELD_GROUPID]=$this->id;
|
||||
}
|
||||
return $info;
|
||||
|
||||
@ -69,8 +69,8 @@ if ($action == 'dolibarr2ldap')
|
||||
{
|
||||
$info=$object->_load_ldap_info();
|
||||
|
||||
// Get a gid number for objectclass PosixGroup
|
||||
if (in_array('posixGroup', $info['objectclass'])) {
|
||||
// Get a gid number for objectclass PosixGroup if none was provided
|
||||
if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
|
||||
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user