Code

Fixed logging
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 May 2007 08:35:36 +0000 (08:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 May 2007 08:35:36 +0000 (08:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6432 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/mimetypes/class_mimetypeGeneric.inc
plugins/admin/ogroups/class_mailogroup.inc
plugins/admin/ogroups/class_ogroup.inc
plugins/admin/ogroups/class_phonequeue.inc
plugins/admin/ogroups/class_termgroup.inc

index 4f53f6b066bd56be93430f133b31a4d15fba7091..882c2b8625551f1e8eea9a3a4109972eec20fac3 100644 (file)
@@ -47,6 +47,8 @@ class mimetype extends plugin
   var $CopyPasteVars        = array("use_gotoMimeFilePattern","use_gotoMimeApplication","use_gotoMimeEmbeddedApplication","iconData",
                                     "gotoMimeLeftClickAction_I","gotoMimeLeftClickAction_E","gotoMimeLeftClickAction_Q","use_gotoMimeIcon");
 
+  var $view_logged  = FALSE;
+
   /* Select options */
   var $MimeGroups                            = array("application","audio","chemical","image","inode","message","model",
                                       "multipart","text","video","x-conference","x-world");
@@ -127,7 +129,6 @@ class mimetype extends plugin
         $this->base= dn2base($ui->dn);
       }
     } else {
-      @log::log("view","mimetypes/".get_class($this),$this->dn);
       $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
     }
 
@@ -149,6 +150,11 @@ class mimetype extends plugin
   {
     $smarty = get_smarty();
 
+    if(!$this->view_logged){
+      $this->view_logged =TRUE;
+      @log::log("view","mimetypes/".get_class($this),$this->dn);
+    }
+
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translation){
       $smarty->assign($name."ACL",$this->getacl($name));
index 7ffe77da6a51dcefd57e6dddbdb62ee81db170fd..933dbb62abdb98979e9bb25cdd1a43cb1223c314 100644 (file)
@@ -10,7 +10,7 @@ class mailogroup extends plugin
   var $attributes= array("mail");
   var $objectclasses= array("kolabGroupOfNames");
   var $members= array();
-
+  var $view_logged = FALSE;
 
   function mailogroup ($config, $dn= NULL, $parent= NULL)
   {
@@ -21,10 +21,6 @@ class mailogroup extends plugin
 
     /* Save initial account state */
     $this->initially_was_account= $this->is_account;
-    
-    if($this->is_account){
-      @log::log("view","ogroups/".get_class($this),$this->dn);
-    }
   }
 
 
@@ -33,6 +29,12 @@ class mailogroup extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","ogroups/".get_class($this),$this->dn);
+    }
+
+
     /* Do we need to flip is_account state? */
     if(isset($_POST['modify_state'])){
       if($this->is_account && $this->acl_is_removeable()){
index 7c13eedc6023de2a6b726925713c9e204b040d3f..d9114eb4edaff2c9f40607d609611a0bf7a656ce 100644 (file)
@@ -30,6 +30,7 @@ class ogroup extends plugin
   var $member= array();
   var $orig_dn= "";
   var $group_dialog= FALSE;
+  var $view_logged = FALSE;
 
   /* attribute list for save action */
   var $attributes= array("cn", "description", "gosaGroupObjects","member");
@@ -94,10 +95,6 @@ class ogroup extends plugin
       $this->base= preg_replace("/^[^,]+,".get_groups_ou()."/","",$this->dn);
     }
 
-    if($this->is_account && $dn != "new"){
-      @log::log("view","ogroup/".get_class($this),$this->dn);
-    }
-
     /* Load member data */
     $this->reload();
   }
@@ -143,10 +140,14 @@ class ogroup extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
+
+    if(!$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","ogroups/".get_class($this),$this->dn);
+    }
 
-//    $this->reload();
 
     /* Do we represent a valid group? */
     if (!$this->is_account){
index c47bd3ce3d1244315d54209e8d2ab2b371e4d867..66933896e956295f2adf2f9fb2a97402ed94ad8f 100644 (file)
@@ -43,6 +43,8 @@ class phonequeue extends plugin
   var $init_HomeServer  = "0";
   var $goFonHomeServers = array();
 
+  var $view_logged = FALSE;
+
   /* attribute list for save action */
   var $attributes= array( "goFonTimeOut","goFonMaxLen","goFonAnnounceFrequency","goFonDialOptiont","goFonDialOptionT",
       "goFonDialOptionh","goFonDialOptionr","cn","goFonHomeServer",
@@ -135,10 +137,6 @@ class phonequeue extends plugin
     $this->goFonQueueStrategy= $tmp[$this->goFonQueueStrategy];
     $this->old_cn = $this->cn;
     $this->old_phone_numbers = $this->telephoneNumber;
-  
-    if($this->is_account){
-      @log::log("view","ogroups/".get_class($this),$this->dn);
-    }
   }
 
 
@@ -198,6 +196,11 @@ class phonequeue extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","ogroups/".get_class($this),$this->dn);
+    }
+
     if(isset($_POST['modify_state'])){
       if($this->is_account && $this->acl_is_removeable()){
         $this->is_account= FALSE;
index 2c8239a3976999a0f6be752dafa4659a8a0dcbbd..b8c1d68dd71aaafd4d2fe7d6c361bbb8944dd13e 100644 (file)
@@ -25,6 +25,8 @@ class termgroup extends plugin
   var $attributes     = array("gotoMode","gotoSyslogServer", "gotoNtpServer");
   var $objectclasses  = array("gotoWorkstationTemplate");
   var $CopyPasteVars  = array("gotoNtpServers","modes","inheritTimeServer","members");
+  var $view_logged    = FALSE;
+
 
   function termgroup ($config, $dn= NULL, $parent= NULL)
   {
@@ -95,10 +97,6 @@ class termgroup extends plugin
         unset($this->gotoNtpServers[$key]);
       }
     }
-
-    if($this->is_account && $dn != "new"){
-      @log::log("view","ogroups/".get_class($this),$this->dn);
-    }
   }
 
   function check()
@@ -183,6 +181,10 @@ class termgroup extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    if(!$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","ogroups/".get_class($this),$this->dn);
+    }
 
     /*************** 
       Handle requested action