fallback for posixGroup no structural object was missing

This commit is contained in:
Ralf Becker 2006-06-08 03:29:07 +00:00
parent 7c203162fa
commit 076711adbf

View File

@ -216,9 +216,18 @@ class accounts_backend
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)) !$old && !ldap_add($this->ds,$dn,$to_write))
{ {
echo "ldap_".($old ? 'modify' : 'add')."(,$dn,".print_r($to_write,true).")\n"; $err = true;
echo ldap_error($this->ds); if (!$old && $is_group)
return false; {
$to_write['objectclass'][] = 'namedobject';
$err = !ldap_add($this->ds,$dn,$to_write);
}
if ($err)
{
echo "ldap_".($old ? 'modify' : 'add')."(,$dn,".print_r($to_write,true).")\n";
echo ldap_error($this->ds);
return false;
}
} }
if ($memberships) // setting the previous memberships of the renamed account if ($memberships) // setting the previous memberships of the renamed account
{ {
@ -754,7 +763,7 @@ class accounts_backend
} }
if (!ldap_modify($this->ds,'cn='.$cn.','.$this->group_context,array('memberUid' => array_values(array_unique($members))))) if (!ldap_modify($this->ds,'cn='.$cn.','.$this->group_context,array('memberUid' => array_values(array_unique($members)))))
{ {
echo "ldap_modify(,'cn=$cn','$this->group_context',array('memberUid' => ".print_r(array_values(array_unique($members)),true)."))\n"; echo "ldap_modify(,'cn=$cn,$this->group_context',array('memberUid' => ".print_r(array_values(array_unique($members)),true)."))\n";
} }
} }