From 504a99150ddca9fb443e73b1979afb3d02333757 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 18 Dec 2008 13:48:38 +0000 Subject: [PATCH] Updated opsi activation . git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13319 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/opsi/admin/opsi/class_opsi.inc | 17 +++++++++++++++++ .../admin/systems/class_systemManagement.inc | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi.inc b/gosa-plugins/opsi/admin/opsi/class_opsi.inc index 92d622deb..b0ea92bdf 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsi.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsi.inc @@ -141,6 +141,23 @@ class opsi extends gosaSupportDaemon } } + + public function job_opsi_activate_client($id,$mac) + { + $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT); + $o_queue = new gosaSupportDaemon(); + if(isset($events['TRIGGERED']['DaemonEvent_activate'])){ + $evt = $events['TRIGGERED']['DaemonEvent_activate']; + $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); + } + } + } + + /****************** SI Communication functions diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 8fcbf72db..722af8e4c 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -1010,6 +1010,11 @@ class systems extends plugin $ldap->cd($this->config->current['BASE']); $ldap->rmdir ($this->systab->dn); @DEBUG(DEBUG_LDAP,__LINE__, __FUNCTION__, __FILE__,"Source removed: ".$this->systab->dn,"Opsi host activated."); + + $hostId = $this->systab->by_object['opsiGeneric']->hostId; + $mac = $this->systab->by_object['opsiGeneric']->mac; + $this->opsi->job_opsi_activate_client($hostId,$mac); + }elseif(isset($this->systab->was_activated) && $this->systab->was_activated){ $this->activate_new_device($this->systab->dn); } -- 2.30.2