fixed error in modification of existing group, if groupOfNames can NOT be used together with posixGroup (nis schema)

This commit is contained in:
Ralf Becker 2006-07-11 02:28:58 +00:00
parent 26e3790620
commit 34346b6847

View File

@ -234,16 +234,16 @@ class accounts_backend
}
//echo "<p>ldap_".($old ? 'modify' : 'add')."(,$dn,".print_r($to_write,true).")</p>\n";
// modifying or adding the entry
if ($old && !ldap_modify($this->ds,$dn,$to_write) ||
if ($old && !@ldap_modify($this->ds,$dn,$to_write) ||
!$old && !@ldap_add($this->ds,$dn,$to_write))
{
$err = true;
if (!$old && $is_group && ($key = array_search('groupofnames',$to_write['objectclass'])) !== false)
if ($is_group && ($key = array_search('groupofnames',$to_write['objectclass'])) !== false)
{
// try again with removed groupOfNames stuff, as I cant detect if posixGroup is a structural object
unset($to_write['objectclass'][$key]);
unset($to_write['member']);
$err = !ldap_add($this->ds,$dn,$to_write);
$err = $old ? !ldap_modify($this->ds,$dn,$to_write) : !ldap_add($this->ds,$dn,$to_write);
}
if ($err)
{