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

@ -215,11 +215,20 @@ class accounts_backend
// modifying or adding the entry // 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)) !$old && !ldap_add($this->ds,$dn,$to_write))
{
$err = true;
if (!$old && $is_group)
{
$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_".($old ? 'modify' : 'add')."(,$dn,".print_r($to_write,true).")\n";
echo ldap_error($this->ds); echo ldap_error($this->ds);
return false; return false;
} }
}
if ($memberships) // setting the previous memberships of the renamed account if ($memberships) // setting the previous memberships of the renamed account
{ {
$this->set_memberships($memberships,$data['account_id']); $this->set_memberships($memberships,$data['account_id']);
@ -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";
} }
} }