From: psc Date: Tue, 29 Jun 2010 15:12:18 +0000 (+0000) Subject: Apply follow-up patch for 1797 from mba X-Git-Url: https://git.tokkee.org/?p=gosa.git;a=commitdiff_plain;h=56c0483ce7f9faf91dcfecd3c59312ead41feb40 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 --- 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; } }