From 7ccc0eb0d020d20d7ccdc4c3a381e0b46603d9e7 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Mar 2008 13:30:38 +0000 Subject: [PATCH] Updated server event hanling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9317 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_workstationGeneric.inc | 16 ++++++++-------- .../systems/goto/class_workstationStartup.inc | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index be0483873..5818f8f6c 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -187,10 +187,10 @@ class workgeneric extends plugin } /* Check if we have an DaemonEvent for this action */ - if(class_available("DaemonEvent_".$action)){ - $events = DaemonEvent::get_event_types(SYSTEM_EVENT); - if(isset($events['BY_CLASS']["DaemonEvent_".$action])){ - $evt = $events['BY_CLASS']["DaemonEvent_".$action]; + if(class_available("DaemonEvent")){ + $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT); + if(isset($events['TRIGGERED']["DaemonEvent_".$action])){ + $evt = $events['TRIGGERED']["DaemonEvent_".$action]; $tmp = new $evt['CLASS_NAME']($this->config); $tmp->add_targets(array($this->netConfigDNS->macAddress)); $tmp->set_type(TRIGGERED_EVENT); @@ -593,14 +593,14 @@ class workgeneric extends plugin $this->netConfigDNS->save(); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic with dn '%s' failed."),$this->dn)); - if ($activate){ + if ($activate && class_available("DaemonEvent")){ /* Send installation activation */ - $events = DaemonEvent::get_event_types(SYSTEM_EVENT); + $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT); $o_queue = new gosaSupportDaemon(); - if(isset($events['BY_CLASS']['DaemonEvent_installation_activation'])){ - $evt = $events['BY_CLASS']['DaemonEvent_installation_activation']; + if(isset($events['TRIGGERED']['DaemonEvent_installation_activation'])){ + $evt = $events['TRIGGERED']['DaemonEvent_installation_activation']; $tmp = new $evt['CLASS_NAME']($this->config); $tmp->set_type(TRIGGERED_EVENT); $tmp->add_targets(array($this->netConfigDNS->macAddress)); diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index be430f76b..2944e8c44 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -897,11 +897,11 @@ class workstartup extends plugin $this->handle_post_events("modify"); /* Check if LDAP server has changed */ - if ($ldap_changed){ - $events = DaemonEvent::get_event_types(SYSETEM_EVENT); + if ($ldap_changed && class_available("DaemonEvent")){ + $events = DaemonEvent::get_event_types(SYSETEM_EVENT | HIDDEN_EVENT); $o_queue = new gosaSupportDaemon(); - if(isset($events['BY_CLASS']['DaemonEvent_reload_ldap_config'])){ - $evt = $events['BY_CLASS']['DaemonEvent_reload_ldap_config']; + 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)); -- 2.30.2