From 41e5698c7d3afde2ff9a0e1e00bc0a816b5940e3 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 24 Jul 2008 13:32:15 +0000 Subject: [PATCH] Fixed non existent config object git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12025 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_log.inc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gosa-core/include/class_log.inc b/gosa-core/include/class_log.inc index f255bd5ad..8b283bd25 100644 --- a/gosa-core/include/class_log.inc +++ b/gosa-core/include/class_log.inc @@ -76,7 +76,7 @@ class log { $entry['changes'] = $changes; $entry['result'] = $result; - if($this->config->get_cfg_value("logging") == "" && empty($entry['user'])){ + if(!isset($config) || ( $this->config->get_cfg_value("logging") == "" && empty($entry['user']))){ $entry['user'] = "unknown"; } @@ -90,16 +90,18 @@ class log { }else{ - if ($this->config->get_cfg_value("logging") == ""){ - $this->log_into_syslog($entry); - }else{ - - /* Start logging for configured methods */ - if(preg_match("/(^|,)syslog(,|$)/i",$this->config->get_cfg_value("logging"))){ + if (isset ($config)){ + if ($this->config->get_cfg_value("logging") == ""){ $this->log_into_syslog($entry); - } - if(preg_match("/(^|,)mysql(,|$)/i",$this->config->get_cfg_value("logging"))){ - $this->log_into_db($entry); + }else{ + + /* Start logging for configured methods */ + if(preg_match("/(^|,)syslog(,|$)/i",$this->config->get_cfg_value("logging"))){ + $this->log_into_syslog($entry); + } + if(preg_match("/(^|,)mysql(,|$)/i",$this->config->get_cfg_value("logging"))){ + $this->log_into_db($entry); + } } } } -- 2.30.2