Code

Updated logging
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 May 2007 04:52:39 +0000 (04:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 May 2007 04:52:39 +0000 (04:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6493 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_config.inc
include/class_log.inc
include/php_setup.inc

index e9b17448b95f22696c644820efc4fe22b78463d1..ca4d376ec23c2d8d3952965ff5620519e3dc2754 100644 (file)
@@ -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]);
index c2f05639157eacd1ee871a10ea50c1984da2c364..ecc3bf16d9ccb543781218ff039c78a6835e3714 100644 (file)
@@ -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;
index 9c2153ed6450ba5a011aa8800b007cca1888b987..ec13459435faafcdfcb6492c3f538883d69db13b 100644 (file)
@@ -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;