Code

stats hardening
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 2 Aug 2010 12:17:50 +0000 (12:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 2 Aug 2010 12:17:50 +0000 (12:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19341 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_stats.inc

index dc2f00b3ab03b628c1a756909dee1ba775886082..441166924957ef8bacff39dc15d2193cfdb2a3f2 100644 (file)
@@ -63,6 +63,8 @@ class stats
         global $clicks;
         global $overallRenderTimer;
 
+
+        if(!isset($clicks) || empty($clicks)) $clicks = 0;
         if(!isset($overallRenderTimer) || empty($overallRenderTimer)){
             $renderTime = 0;
         }else{
@@ -74,12 +76,17 @@ class stats
             
         }
 
+        if(is_object($config) && $config instanceOf config){
+            $uuid = $config->getGOsaUUID();
+        }else{
+            $uuid = "";
+        }
+
         $type           = sqlite_escape_string($type);
         $plugin         = sqlite_escape_string($plugin);
         $action         = sqlite_escape_string($action);
         $timestamp      = time();
         $mtimestamp     = microtime(TRUE);
-        $uuid           = $config->getGOsaUUID();
         $amount         = sqlite_escape_string($amount);
         $duration       = sqlite_escape_string($duration);
         $renderTime     = sqlite_escape_string($renderTime);