summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0c70263)
raw | patch | inline | side by side (parent: 0c70263)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Feb 2008 07:47:31 +0000 (07:47 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Feb 2008 07:47:31 +0000 (07:47 +0000) |
-Implemented trigger action.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9143 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9143 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/systems/admin/systems/class_systemManagement.inc | patch | blob | history |
diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index d2f695baab99468eeb2794c0c7b6db979392ca27..7b1454225790581844f85efbd20de23468df7187 100644 (file)
/********************
SCHEDULE action in GOsa Daemon
********************/
- if(preg_match("/^schedule_event_/",$s_action)){
+ $save_events_directly = FALSE;
+ if(preg_match("/^schedule_event_/",$s_action) || preg_match("/^trigger_event_/",$s_action)){
$this->dns = array();
$ids = $this->list_get_selected_items();
}
}
$events = DaemonEvent::get_event_types();
- $type = preg_replace("/^schedule_event_/","",$s_action);
+ if(preg_match("/^trigger_event_/",$s_action)){
+ $type = preg_replace("/^trigger_event_/","",$s_action);
+ }else{
+ $type = preg_replace("/^schedule_event_/","",$s_action);
+ }
if(count($mac) && isset($events['BY_CLASS'][$type])){
$event = $events['BY_CLASS'][$type];
$this->systab = new $event['CLASS_NAME']($this->config);
$this->systab->add_targets($mac);
+
+ /* Insert event directly with current timestamp
+ * to force direct execution.
+ */
+ if(preg_match("/^trigger_event_/",$s_action)){
+ $this->systab->set_timestamp(time());
+ $save_events_directly = TRUE;
+ }
}
}
}
/* Insert scheduled events into queue */
if($this->systab instanceof DaemonEvent){
$this->systab->save_object();
- if(isset($_POST['save_event_dialog'])){
- $header = $this->systab->get_header_tag();
+ if(isset($_POST['save_event_dialog']) || $save_events_directly){
+ $header = $this->systab->get_schedule_action();
$targets = $this->systab->get_targets();
$data = $this->systab->save();
$data['timestamp'] = $this->systab->get_timestamp();