From: hickert Date: Mon, 17 Mar 2008 07:20:13 +0000 (+0000) Subject: Updated WorkstationStartup. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a4b8bb2cd43785679209f57ac965a495429b144f;p=gosa.git Updated WorkstationStartup. -Editing of an ogroup caused caused PHP warnings and the Daemon Eevents failed. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9889 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 809a6d350..17f3ae958 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -902,11 +902,39 @@ class workstartup extends plugin $o_queue = new gosaSupportDaemon(); if(isset($events['TRIGGERED']['DaemonEvent_reload_ldap_config'])){ $evt = $events['TRIGGERED']['DaemonEvent_reload_ldap_config']; - $tmp = new $evt['CLASS_NAME']($this->config); - $tmp->set_type(TRIGGERED_EVENT); - $tmp->add_targets(array($this->parent->by_object['workgeneric']->netConfigDNS->macAddress)); - if(!$o_queue->append($tmp)){ - msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG); + $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 + */ + foreach($macs as $mac){ + $tmp = new $evt['CLASS_NAME']($this->config); + $tmp->set_type(TRIGGERED_EVENT); + $tmp->add_targets(array($mac)); + if(!$o_queue->append($tmp)){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG); + } } } }