X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=trunk%2Fgosa-core%2Finclude%2Fclass_log.inc;h=045cca27f2838971828563a10909db4ce02c1ebf;hb=56c0483ce7f9faf91dcfecd3c59312ead41feb40;hp=4b846e5722e26f1811178f9ba6aac370a5a51eb7;hpb=8feff3e77980fb5fc17d58d348d58e29548c4b81;p=gosa.git diff --git a/trunk/gosa-core/include/class_log.inc b/trunk/gosa-core/include/class_log.inc index 4b846e572..045cca27f 100644 --- a/trunk/gosa-core/include/class_log.inc +++ b/trunk/gosa-core/include/class_log.inc @@ -157,6 +157,32 @@ class log { $error = ""; + /* Check GosaUnitTag + */ + global $config; + $ui = get_userinfo(); + if (isset($config->current['HONOURUNITTAGS']) && + preg_match('/true/i', $config->current['HONOURUNITTAGS']) && + $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)))"); + + if (!$ldap->count()){ + /* Remove server from config + */ + 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; + } + } + /* Connect to the database */ $con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']);