X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_log.inc;h=fbdbb371c72b953e34a4b1dd78325e6fdb5c4c86;hb=62c2547a71af33f8815bf3627822599c95153527;hp=fa4482e6b3b97ad794f8abde63e86ee546fb8179;hpb=d6cdd7f021f147c2416a8296c4e296d9bb37e933;p=gosa.git diff --git a/gosa-core/include/class_log.inc b/gosa-core/include/class_log.inc index fa4482e6b..fbdbb371c 100644 --- a/gosa-core/include/class_log.inc +++ b/gosa-core/include/class_log.inc @@ -52,11 +52,11 @@ class log { } $entry = array(); - if(!session::is_set('config')){ + if(!session::global_is_set('config')){ $entry['user']= "unkown"; }else{ - $this->config = session::get('config'); + $this->config = session::global_get('config'); $ui = get_userinfo(); $entry['user']= @$ui->dn; } @@ -76,7 +76,7 @@ class log { $entry['changes'] = $changes; $entry['result'] = $result; - if(!isset($this->config->current['LOGGING']) && empty($entry['user'])){ + if(!isset($this->config) || ( $this->config->get_cfg_value("logging") == "" && empty($entry['user']))){ $entry['user'] = "unknown"; } @@ -90,16 +90,18 @@ class log { }else{ - if(!isset($this->config->current['LOGGING'])){ - $this->log_into_syslog($entry); - }else{ - - /* Start logging for configured methods */ - if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)syslog(,|$)/i",$this->config->current['LOGGING'])){ + if (isset ($this->config)){ + if ($this->config->get_cfg_value("logging") == ""){ $this->log_into_syslog($entry); - } - if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)mysql(,|$)/i",$this->config->current['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); + } } } } @@ -157,6 +159,7 @@ class log { /* Connect to the database */ + ini_set("mysql.connect_timeout",5); $con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']); if(!$con){ $error = msgPool::dbconnect(_("MySQL logging"),mysql_error());