Fix: gidNumber ldap attribute was not defined i using posixGroup objectClass

This commit is contained in:
Eden 2014-09-19 20:36:02 +02:00 committed by jfefe
parent 3b53ccbe44
commit 248ef4fd46
2 changed files with 8 additions and 0 deletions

View File

@ -219,6 +219,10 @@ if (function_exists("ldap_connect"))
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
// Get a gid number for objectclass PosixGroup
if(in_array('posixGroup',$info['objectclass']))
$info['gidNumber'] = $ldap->getNextGroupGid();
$result1=$ldap->delete($dn); // To be sure to delete existing records
$result2=$ldap->add($dn,$info,$user); // Now the test
$result3=$ldap->delete($dn); // Clean what we did

View File

@ -64,6 +64,10 @@ if ($action == 'dolibarr2ldap')
$result=$ldap->connect_bind();
$info=$fgroup->_load_ldap_info();
// Get a gid number for objectclass PosixGroup
if(in_array('posixGroup',$info['objectclass']))
$info['gidNumber'] = $ldap->getNextGroupGid();
$dn=$fgroup->_load_ldap_dn($info);
$olddn=$dn; // We can say that old dn = dn as we force synchro