From 8c4dd45ec8ed784b14476adc99a4563ac6364865 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Feb 2008 07:47:31 +0000 Subject: [PATCH] Updated system management. -Implemented trigger action. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9143 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index d2f695baa..7b1454225 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -499,7 +499,8 @@ class systems extends plugin /******************** 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(); @@ -515,11 +516,23 @@ class systems extends plugin } } $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; + } } } } @@ -527,8 +540,8 @@ class systems extends plugin /* 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(); -- 2.30.2