Code

- Yeah, we have complete svn build of GOsa, GOto, GOsa-si with svn tags and
[gosa.git] / gosa-core / include / class_log.inc
index bbe31517e228cac1741b3768d6782ddf371138fd..33e58523a94abddb8a76b4cd4bf8edc1fcc187d9 100644 (file)
@@ -76,7 +76,7 @@ class log {
     $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";
     }
  
@@ -90,7 +90,7 @@ class log {
       
     }else{
 
-      if (isset ($config)){
+      if (isset ($this->config)){
         if ($this->config->get_cfg_value("logging") == ""){
           $this->log_into_syslog($entry);
         }else{
@@ -127,7 +127,12 @@ class log {
   /* This function is used to into the systems syslog */
   function log_into_syslog($entry)
   {
-    $str = $entry['user']." ".$entry['action']." ".$entry['object']." from type ".$entry['objecttype']." ".$entry['changes']." : Result was ".$entry['result'];
+    $str= "";
+    if (empty($entry['object']) && empty($entry['changes'])) {
+      $str = "(".$entry['action'].") ".$entry['objecttype'].": ".$entry['result'];
+    } else {
+      $str = "(".$entry['action'].") ".$entry['object']." of type ".$entry['objecttype']." ".$entry['changes'].": ".$entry['result'];
+    }
     gosa_log($str);
   }
 
@@ -159,6 +164,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());