From d2cc37510d8494f2e6fbc0eb2c1a57e38833d839 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 15 Apr 2008 09:22:45 +0000 Subject: [PATCH] Updated repository service -Send reload event to si, if the repositories have changed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10450 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../repository/class_servRepository.inc | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/goto/admin/systems/services/repository/class_servRepository.inc b/gosa-plugins/goto/admin/systems/services/repository/class_servRepository.inc index 265d825fc..734618ef6 100644 --- a/gosa-plugins/goto/admin/systems/services/repository/class_servRepository.inc +++ b/gosa-plugins/goto/admin/systems/services/repository/class_servRepository.inc @@ -307,14 +307,19 @@ class servrepository extends goService $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($this->attrs); - $this->handle_post_events("modify"); + if(count($this->attrs)){ + $this->trigger_si_fai_server_reload(); + } }else{ $ldap->cd ($this->config->current['BASE']); $ldap->create_missing_trees($this->dn); $ldap->cd($this->dn); $ldap->add($this->attrs); $this->handle_post_events("add"); + if(count($this->attrs)){ + $this->trigger_si_fai_server_reload(); + } } if($this->initially_was_account){ @@ -334,6 +339,33 @@ class servrepository extends goService return($fields); } + + function trigger_si_fai_server_reload() + { + /* Reload GOsa si FAI DB/cache + */ + if(class_available("DaemonEvent") && class_available("gosaSupportDaemon")){ + $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT); + if(isset($events['TRIGGERED']['DaemonEvent_recreate_fai_server_db'])){ + $evt = $events['TRIGGERED']['DaemonEvent_recreate_fai_server_db']; + $tmp = new $evt['CLASS_NAME']($config); + $tmp->set_type(TRIGGERED_EVENT); + $tmp->add_targets(array("GOsa")); + $o_queue = new gosaSupportDaemon(); + if(!$o_queue->append($tmp)){ + msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG); + } + } + } + } + + + function remove_from_parent() + { + goService::remove_from_parent(); + $this->trigger_si_fai_server_reload(); + } + /* Return plugin informations for acl handling */ static function plInfo() { -- 2.30.2