Code

Bugfix for #4721
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 May 2010 09:56:29 +0000 (09:56 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 May 2010 09:56:29 +0000 (09:56 +0000)
Before creating multiple events filter duplicates.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@18032 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc

index b255b1a2d50e922bc4aae0fdd53a058cf35b6d36..13f80c9dcbff83c2aa5ff3717b0206f652e17fd9 100644 (file)
@@ -431,6 +431,17 @@ class DaemonEvent
       if($dialog->multiple_events) {
         $event_type = get_class($dialog);
         $targets = $dialog->get_targets();
+        $tmp_array[0] = $targets[0];
+        foreach ($targets as $current) {
+          $add_flag = 1;
+          foreach ($tmp_array as $tmp) {
+            if ($current["mac"]==$tmp["mac"]) {
+              $add_flag = 0; break;
+            }
+          }
+          if ($add_flag) $tmp_array[] = $current;
+        }
+        $targets = $tmp_array;
         $timestamp = $dialog->timestamp;
 
         $i = 1;