From: hickert Date: Fri, 4 Jul 2008 12:11:13 +0000 (+0000) Subject: Updated workstation service saving X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a9ba6859b21c530a6cea4748eb438303b04000a6;p=gosa.git Updated workstation service saving - Send goto reload event, if attributes changed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11536 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index c7b73b6d0..c78dc4696 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -447,6 +447,12 @@ class workservice extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); $this->cleanup(); + + /* Send goto reload event to gosaSupportDaemon */ + if(count($this->attrs)){ + $this->send_goto_reload(); + } + $ldap->modify ($this->attrs); new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); if (!$ldap->success()){ @@ -507,6 +513,34 @@ class workservice extends plugin )); } + + /*! \brief Send goto_reload event to support daemon + */ + function send_goto_reload() + { + $targets = array(); + if(isset($this->parent) && ($this->parent instanceOf worktabs)){ + $targets[] = $this->parent->by_object['workgeneric']->netConfigDNS->ipHostNumber; + } + if(isset($this->parent) && ($this->parent instanceOf ogrouptabs)){ + $member = $this->parent->by_object['ogroup']->member; + $oc = $this->parent->by_object['ogroup']->objcache; + foreach($member as $mem){ + if(isset($oc[$mem]['macAddress'])){ + $targets[] = $oc[$mem]['macAddress']; + } + } + } + if(count($targets) && class_available("gosaSupportDaemon") && class_available("DaemonEvent_goto_reload")){ + $o_g = new gosaSupportDaemon(); + $evt = new DaemonEvent_goto_reload($this->config); + $evt -> set_type(TRIGGERED_EVENT); + $evt -> add_targets($targets); + $o_g->append($evt); + } + } + + function PrepareForCopyPaste($source) { plugin::PrepareForCopyPaste($source);