Code

Updated roleManagement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Dec 2009 08:02:23 +0000 (08:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Dec 2009 08:02:23 +0000 (08:02 +0000)
-Ensure that objects are added only once.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14899 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc

index d71a1b6a8c4caedc007c97e298cf73f7d2f1d1ca..f4b821b99de0097852884cf3258cfff4377d906c 100644 (file)
@@ -281,9 +281,11 @@ class roleGeneric extends plugin {
   function save()
   {
   
-    $this->reload();
-    plugin::save();
+    // Ensure that we've added objects only once.
+    $this->roleOccupant = array_unique($this->roleOccupant);
+    $this->roleOccupant = array_values($this->roleOccupant);
 
+    plugin::save();
 
     /* Save data. Using 'modify' implies that the entry is already present, use 'add' for
        new entries. So do a check first... */