Fix removing users.
authorJan Schneider <jan@horde.org>
Mon, 13 Sep 2010 13:34:53 +0000 (15:34 +0200)
committerJan Schneider <jan@horde.org>
Mon, 13 Sep 2010 13:35:11 +0000 (15:35 +0200)
framework/Group/lib/Horde/Group/Ldap.php
framework/Group/lib/Horde/Group/LdapObject.php

index 354ce95..357bd92 100644 (file)
@@ -303,7 +303,7 @@ class Horde_Group_Ldap extends Horde_Group
      * @throws Horde_History_Exception
      * @throws InvalidArgumentException
      */
-    public function updateGroup(Horde_Group_DataTreeObject $group)
+    public function updateGroup(Horde_Group_LdapObject $group)
     {
         $entry = $group->toAttributes();
 
index 88554c0..0feddd0 100644 (file)
@@ -106,7 +106,8 @@ class Horde_Group_LdapObject extends Horde_Group_DataTreeObject
      */
     public function toAttributes()
     {
-        $attributes = array();
+        $member = Horde_String::lower($GLOBALS['conf']['group']['params']['memberuid']);
+        $attributes = array($member => array());
         foreach ($this->data as $key => $value) {
             if ($key == 'users') {
                 foreach ($value as $user => $membership) {
@@ -114,7 +115,7 @@ class Horde_Group_LdapObject extends Horde_Group_DataTreeObject
                         $user = $GLOBALS['conf']['auth']['params']['uid'] .
                             '=' . $user . ',' . $GLOBALS['conf']['auth']['params']['basedn'];
                     }
-                    $attributes[Horde_String::lower($GLOBALS['conf']['group']['params']['memberuid'])][] = $user;
+                    $attributes[$member][] = $user;
                 }
             } elseif ($key == 'email') {
                 if (!empty($value)) {