Code

Updated ogroup add member behavior
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Feb 2006 08:16:49 +0000 (08:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Feb 2006 08:16:49 +0000 (08:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2644 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_ogroup.inc

index 22111b073ab29748e54a666b69ac5d0a1ac6db38..136562a6308b0383e877bc82469b7847e8873365 100644 (file)
@@ -93,29 +93,39 @@ class ogroup extends plugin
     $this->reload();
   }
 
-  function AddDelMembership(){
-     /* Delete objects from group */
-    if (isset($_POST['delete_membership']) && isset($_POST['members'])){
-      foreach ($_POST['members'] as $value){
-        $this->objects["$value"]= $this->memberList[$value];
-        unset ($this->memberList["$value"]);
-        unset ($this->member["$value"]);
-        uasort ($this->objects, 'sort_list');
-        reset ($this->objects);
-      }
+  function AddDelMembership($NewMember = false){
+
+    if($NewMember){
+      $this->memberList[$NewMember]= $this->allobjects[$NewMember];
+      $this->member[$NewMember]= $NewMember;
+      unset ($this->objects[$NewMember]);
+      uasort ($this->memberList, 'sort_list');
+      reset ($this->memberList);
       $this->reload();
-    }
+    }else{
+      /* Delete objects from group */
+      if (isset($_POST['delete_membership']) && isset($_POST['members'])){
+        foreach ($_POST['members'] as $value){
+          $this->objects["$value"]= $this->memberList[$value];
+          unset ($this->memberList["$value"]);
+          unset ($this->member["$value"]);
+          uasort ($this->objects, 'sort_list');
+          reset ($this->objects);
+        }
+        $this->reload();
+      }
 
-    /* Add objects to group */
-    if (isset($_POST['add_object_finish']) && isset($_POST['objects'])){
-      foreach ($_POST['objects'] as $value){
-        $this->memberList["$value"]= $this->objects[$value];
-        $this->member["$value"]= $value;
-        unset ($this->objects[$value]);
-        uasort ($this->memberList, 'sort_list');
-        reset ($this->memberList);
+      /* Add objects to group */
+      if (isset($_POST['add_object_finish']) && isset($_POST['objects'])){
+        foreach ($_POST['objects'] as $value){
+          $this->memberList["$value"]= $this->objects[$value];
+          $this->member["$value"]= $value;
+          unset ($this->objects[$value]);
+          uasort ($this->memberList, 'sort_list');
+          reset ($this->memberList);
+        }
+        $this->reload();
       }
-      $this->reload();
     }
   }