index bbe31517e228cac1741b3768d6782ddf371138fd..ed93a631ce0f32a99f4ff83a39cabeff0aabea6e 100644 (file)
$entry['changes'] = $changes;
$entry['result'] = $result;
- if(!isset($config) || ( $this->config->get_cfg_value("logging") == "" && empty($entry['user']))){
+ if(!isset($this->config) || ( $this->config->get_cfg_value("logging") == "" && empty($entry['user']))){
$entry['user'] = "unknown";
}
}else{
- if (isset ($config)){
+ if (isset ($this->config)){
if ($this->config->get_cfg_value("logging") == ""){
$this->log_into_syslog($entry);
}else{
$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']);