From: hickert Date: Fri, 29 Feb 2008 06:34:37 +0000 (+0000) Subject: Updated Systems management X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4331eb706d69ca050c5c495bd80c62b4c3ff67be;p=gosa.git Updated Systems management -Add events for new devices git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9197 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index e2d733c23..98128010c 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -879,6 +879,42 @@ class systems extends plugin } $this->systab->save(); + + /* Get macAddress to be able to an installation event + */ + if($this->systab instanceof ArpNewDeviceTabs || session::is_set('SelectedSystemType')){ + $events = DaemonEvent::get_event_types(); + + /* Get mac of currently edited entry */ + $mac = ""; + if($this->systab instanceof ArpNewDeviceTabs){ + $mac = $this->systab->by_object['ArpNewDevice']->netConfigDNS->macAddress; + }else{ + foreach(array("workgeneric","termgeneric","servgeneric") as $type){ + if(isset($this->systab->by_object[$type]->netConfigDNS->macAddress)){ + $mac = $this->systab->by_object[$type]->netConfigDNS->macAddress; + break; + } + } + } + + /* Add installation event + */ + if(!empty($mac) && isset($events['BY_CLASS']['DaemonEvent_install'])){ + $evt = $events['BY_CLASS']['DaemonEvent_install']; + $tmp = new $evt['CLASS_NAME']($this->config); + $tmp->add_targets(array($mac)); + $header = $tmp->get_trigger_action(); + $data = $tmp->save(); + $data['macaddress'] = $mac; + $o_queue = new gosaSupportDaemon(); + $o_queue->send_data($header,$mac,$data,TRUE); + if($o_queue->is_error()){ + msg_dialog::display(_("Daemon"),sprintf(_("Something went wrong while talking to the daemon: %s."), + $o_queue->get_error()),ERROR_DIALOG); + } + } + } if(session::is_set('SelectedSystemType')){ session::un_set('SelectedSystemType');