From 7bf4dc15c75980577ca704b8ee47c37cebe1c008 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 9 Feb 2006 08:16:49 +0000 Subject: [PATCH] Updated ogroup add member behavior git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2644 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_ogroup.inc | 50 +++++++++++++++----------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 22111b073..136562a63 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -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(); } } -- 2.30.2