Code

Updated goto, skip entries which are on the remove queue
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 May 2008 09:06:26 +0000 (09:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 May 2008 09:06:26 +0000 (09:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10965 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/goto/class_gotomasses.inc

index b7f0e6ef7eac8d17ec59de9e0c214529dbc334e2..31652669931c59a6ee24460dd0d9f3b5fd42bcf9 100644 (file)
@@ -45,6 +45,8 @@ class gotomasses extends plugin
   var $range    = 25;
   var $start    = 0;
 
+  var $recently_removed = array();
+
   function gotomasses(&$config, $dn= NULL)
   {
     /* Include config object */
@@ -681,6 +683,8 @@ class gotomasses extends plugin
       $tmp = new DaemonEvent_faireboot($this->config);
       $tmp->add_targets($update_ids);
       $tmp->set_type(TRIGGERED_EVENT);
+      $this->recently_removed = $update_ids;
+      
       if(!$this->o_queue->append($tmp)){
         msg_dialog::display(_("Error"), sprintf(_("Cannot update queue entry: %s"),$id) , ERROR_DIALOG);
         return(FALSE);
@@ -771,8 +775,14 @@ class gotomasses extends plugin
     $this->entries = array();
     
     foreach($entries as $entry){
+    
+      /* Skip entries which will be removed within the next seconds */
+      if(isset($entry['MACADDRESS']) && in_array($entry['MACADDRESS'],$this->recently_removed)){
+        continue;
+      }
       $this->entries[$entry['ID']]= $entry;
     }
+    $this->recently_removed = array();
   }