From: hickert Date: Tue, 29 May 2007 04:52:39 +0000 (+0000) Subject: Updated logging X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=04d9837e72728c01a0449760b158bd8616065d84;p=gosa.git Updated logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6493 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_config.inc b/include/class_config.inc index e9b17448b..ca4d376ec 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -440,6 +440,7 @@ class config { $attrs= $ldap->fetch(); $this->data['SERVERS']['LOGGING'][$attrs['cn'][0]]= array( + 'DN' => $attrs['dn'], 'USER' => $attrs['goLogDBUser'][0], 'DB' => $attrs['goLogDB'][0], 'PWD' => $attrs['goLogDBPassword'][0]); diff --git a/include/class_log.inc b/include/class_log.inc index c2f056391..ecc3bf16d 100644 --- a/include/class_log.inc +++ b/include/class_log.inc @@ -45,8 +45,15 @@ class log { */ function log($action,$objecttype,$object,$changes_array = array(),$result = TRUE) { - $this->config = $_SESSION['config']; - $ui = get_userinfo(); + $entry = array(); + if(!isset($_SESSION['config'])){ + $entry['user']= "unkown"; + }else{ + + $this->config = $_SESSION['config']; + $ui = get_userinfo(); + $entry['user']= @$ui->dn; + } /* Create string out of changes */ $changes =""; @@ -56,9 +63,7 @@ class log { $changes = preg_replace("/,$/","",$changes ); /* Create data object */ - $entry = array(); $entry['timestamp'] = time(); - $entry['user'] = @$ui->dn; $entry['action'] = $action; $entry['objecttype']= $objecttype; $entry['object'] = $object; diff --git a/include/php_setup.inc b/include/php_setup.inc index 9c2153ed6..ec1345943 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -22,6 +22,10 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) { global $error_collector,$config; + if(@class_exists("log")){ + new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline); + } + /* Return if error reporting is set to zero */ if (error_reporting() == 0){ return;