From caf012cda48cbccf20748bdc1fa427a2edf054d3 Mon Sep 17 00:00:00 2001 From: psc Date: Tue, 29 Jun 2010 13:06:24 +0000 Subject: [PATCH] Apply patch for 1797 from mba In the logging function pay respect to the gosa unittags by filtering the servers on the fly and removing servers if they don't match the unittag (to avoid another LDAP query the next time) git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@18863 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-core/include/class_log.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/trunk/gosa-core/include/class_log.inc b/trunk/gosa-core/include/class_log.inc index 4b846e572..ed93a631c 100644 --- a/trunk/gosa-core/include/class_log.inc +++ b/trunk/gosa-core/include/class_log.inc @@ -157,6 +157,26 @@ class log { $error = ""; + /* Check GosaUnitTag + */ + global $config; + $ui = get_userinfo(); + if (isset($config->current['HONOURUNITTAGS']) && + preg_match('/true/i', $config->current['HONOURUNITTAGS']) && + $ui->gosaUnitTag != '') { + $ldap = $this->config->get_ldap_link() ; + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(&(objectClass=gosaLogServer)(gosaUnitTag=$ui->gosaUnitTag)(cn=$server_name)))"); + + if (!$ldap->count()){ + /* Remove server from config + */ + unset($config->data['SERVERS']['LOGGING'][$server_name]); + $this->config = $config; + continue; + } + } + /* Connect to the database */ $con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']); -- 2.30.2