Code

Fixed logging for departments and applications
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 May 2007 06:10:25 +0000 (06:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 May 2007 06:10:25 +0000 (06:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6429 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/departments/class_departmentGeneric.inc

index 5ecab3a94495d85905ba0af1a94ea12f9717e4ca..3b744aa1bd04ffccbc10b61515c5f9fdb16a8a28 100644 (file)
@@ -16,6 +16,7 @@ class application extends plugin
   var $gosaApplicationIcon= "";
   var $gotoLogonScript ="";
   var $iconData;
+  var $view_logged = FALSE;
 
   /* Headpage attributes */
   var $last_sorting= "invalid";
@@ -70,10 +71,6 @@ class application extends plugin
         $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
       }
     }
-      
-    if($this->is_account && $dn != "new"){
-      @log::log("view","application/".get_class($this),$this->dn);
-    }
   }
 
 
@@ -118,6 +115,12 @@ class application extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    /* Log view */
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","application/".get_class($this),$this->dn);
+    }
+
     $smarty= get_smarty();
 
     $tmp = $this->plInfo();
index 9f96a555aeb09652d543a93690cac61b3d7d7728..2b637e06e938cf90deb3151edfae60222a0b31ea 100644 (file)
@@ -33,7 +33,7 @@ class department extends plugin
        var $orig_dn= "";
        var $is_administrational_unit= false;
        var $gosaUnitTag= "";
-
+  var $view_logged = FALSE;
        var $rec_dst=false;     // Destination for recursive move
        var $rec_src=false;     // Source for recursive move 
        var $rec_cpy=false;     // Is recursive move requested ? 
@@ -90,10 +90,6 @@ class department extends plugin
                        $this->is_administrational_unit= true;
       $this->initially_was_tagged = true;
                }
-
-    if($this->is_account && $dn != "new"){
-      @log::log("view","department/".get_class($this),$this->dn);
-    }
        }
 
        function execute()
@@ -101,6 +97,12 @@ class department extends plugin
                /* Call parent execute */
                plugin::execute();
 
+    /* Log view */
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","department/".get_class($this),$this->dn);
+    }
+
                /* Reload departments */
                $this->config->get_departments($this->dn);
                $this->config->make_idepartments();