From 076711adbf7b28723ce1a58600dbf840d9aec347 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 8 Jun 2006 03:29:07 +0000 Subject: [PATCH] fallback for posixGroup no structural object was missing --- phpgwapi/inc/class.accounts_ldap.inc.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index 0a6ddc30db..8c7327d480 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -216,9 +216,18 @@ class accounts_backend if ($old && !ldap_modify($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"; - echo ldap_error($this->ds); - return false; + $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_error($this->ds); + return false; + } } 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))))) { - 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"; } }