From 50389842bac27e93892a18a40086a160de3f481d Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 11 Sep 2008 09:54:08 +0000 Subject: [PATCH] Updated workservice (Devices) -Added event DaemonEvent_goto_reload if something has changed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12416 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_workstationService.inc | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index 4ce1742fe..d9580d3b9 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -448,6 +448,51 @@ class workservice extends plugin $ldap->cd($this->dn); $this->cleanup(); + /* Send SI event to reload goto settings if some options have changed. + */ + if(count($this->attrs) && class_available("DaemonEvent")){ + $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT); + + $o_queue = new gosaSupportDaemon(); + if(isset($events['TRIGGERED']['DaemonEvent_goto_reload'])){ + $evt = $events['TRIGGERED']['DaemonEvent_goto_reload']; + $macs = array(); + + /* Get list of macAddresses + */ + if(isset($this->parent->by_object['ogroup'])){ + + /* If we are an object group, add all member macs + */ + $p = $this->parent->by_object['ogroup']; + foreach($p->memberList as $dn => $obj){ + if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){ + $macs[] = $p->objcache[$dn]['macAddress']; + } + } + }elseif(isset($this->parent->by_object['workgeneric']->netConfigDNS->macAddress)){ + + /* We are a workstation. Add current mac. + */ + $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress; + if(!empty($mac)){ + $macs[] = $mac; + } + } + + /* Trigger event for all member objects + */ + if(count($macs)){ + $tmp = new $evt['CLASS_NAME']($this->config); + $tmp->set_type(TRIGGERED_EVENT); + $tmp->add_targets($macs); + if(!$o_queue->append($tmp)){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG); + } + } + } + } + /* Send goto reload event to gosaSupportDaemon */ if(count($this->attrs)){ $this->send_goto_reload(); -- 2.30.2