Code

Updated FAI management release creation.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jul 2008 12:57:24 +0000 (12:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jul 2008 12:57:24 +0000 (12:57 +0000)
-Added recreate release db event if a new release was created

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

gosa-plugins/fai/admin/fai/class_faiManagement.inc

index d26a71773bccef1d3643a41fbfdc64a3be1a1809..191c36bc214ba4ebbc1ceba6726455f88f42280c 100644 (file)
@@ -616,6 +616,11 @@ class faiManagement extends plugin
         msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG);
       }else{
 
+        /* In order to see error messages we have to reset the error handler.
+            Due to the exit(); 
+         */
+        restore_error_handler();
+
         /* Create it know */
         $this->dispNewBranch = false;
         $this->dispNewFreeze = false;
@@ -733,6 +738,25 @@ class faiManagement extends plugin
         $this->lock_name  = $name; 
         $this->lock_dn    = $baseToUse;
         $this->postcreate();
+
+
+        /* Send daemon event to reload the fai release database 
+         */
+        if(class_available("DaemonEvent") && class_available("gosaSupportDaemon")){
+          $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
+          if(isset($events['TRIGGERED']['DaemonEvent_recreate_fai_release_db'])){
+            $evt = $events['TRIGGERED']['DaemonEvent_recreate_fai_release_db'];
+            $tmp = new $evt['CLASS_NAME']($this->config);
+            $tmp->set_type(TRIGGERED_EVENT);
+            $tmp->add_targets(array("GOsa"));
+            $o_queue = new gosaSupportDaemon();
+            if(!$o_queue->append($tmp)){
+              msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
+            }
+          }
+        }else{  
+          trigger_error("Unknown class DaemonEvent / gosaSupportDaemon");
+        }
         exit();
       }
     }