From 56c0483ce7f9faf91dcfecd3c59312ead41feb40 Mon Sep 17 00:00:00 2001 From: psc Date: Tue, 29 Jun 2010 15:12:18 +0000 Subject: [PATCH] Apply follow-up patch for 1797 from mba Avoid repeating LDAP queries on every log request git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@18874 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-core/include/class_log.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trunk/gosa-core/include/class_log.inc b/trunk/gosa-core/include/class_log.inc index ed93a631c..045cca27f 100644 --- a/trunk/gosa-core/include/class_log.inc +++ b/trunk/gosa-core/include/class_log.inc @@ -163,7 +163,8 @@ class log { $ui = get_userinfo(); if (isset($config->current['HONOURUNITTAGS']) && preg_match('/true/i', $config->current['HONOURUNITTAGS']) && - $ui->gosaUnitTag != '') { + $ui->gosaUnitTag != '' && + !isset($config->data['SERVERS']['LOGGING'][$server_name]['UNITTAG'])) { $ldap = $this->config->get_ldap_link() ; $ldap->cd($this->config->current['BASE']); $ldap->search("(&(&(objectClass=gosaLogServer)(gosaUnitTag=$ui->gosaUnitTag)(cn=$server_name)))"); @@ -174,6 +175,11 @@ class log { unset($config->data['SERVERS']['LOGGING'][$server_name]); $this->config = $config; continue; + } else { + /* Add gosaUnitTag to config for future reference + */ + $config->data['SERVERS']['LOGGING'][$server_name]['UNITTAG'] = $ui->gosaUnitTag; + $this->config = $config; } } -- 2.30.2