From 835d5ee4a074377adc466dc9bf65b6b1e7a959f1 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 22 May 2007 08:35:36 +0000 Subject: [PATCH] Fixed logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6432 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/mimetypes/class_mimetypeGeneric.inc | 8 +++++++- plugins/admin/ogroups/class_mailogroup.inc | 12 +++++++----- plugins/admin/ogroups/class_ogroup.inc | 15 ++++++++------- plugins/admin/ogroups/class_phonequeue.inc | 11 +++++++---- plugins/admin/ogroups/class_termgroup.inc | 10 ++++++---- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 4f53f6b06..882c2b862 100644 --- a/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -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)); diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc index 7ffe77da6..933dbb62a 100644 --- a/plugins/admin/ogroups/class_mailogroup.inc +++ b/plugins/admin/ogroups/class_mailogroup.inc @@ -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()){ diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 7c13eedc6..d9114eb4e 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -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){ diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index c47bd3ce3..66933896e 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -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; diff --git a/plugins/admin/ogroups/class_termgroup.inc b/plugins/admin/ogroups/class_termgroup.inc index 2c8239a39..b8c1d68dd 100644 --- a/plugins/admin/ogroups/class_termgroup.inc +++ b/plugins/admin/ogroups/class_termgroup.inc @@ -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 -- 2.30.2