From 102a7007843b3b13a95ed37d3df3b73a81da6fce Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 21 May 2007 08:54:45 +0000 Subject: [PATCH] fixed logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6413 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/environment/class_environment.inc | 18 ++++++++++-------- plugins/personal/generic/class_user.inc | 10 ++++++++-- plugins/personal/mail/class_mailAccount.inc | 12 +++++++----- .../personal/nagios/class_nagiosAccount.inc | 11 +++++++---- plugins/personal/netatalk/class_netatalk.inc | 11 +++++++---- plugins/personal/posix/class_posixAccount.inc | 12 ++++++++---- plugins/personal/samba/class_sambaAccount.inc | 15 +++++++++------ 7 files changed, 56 insertions(+), 33 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 7c18c08ef..a2313aaf4 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -17,6 +17,7 @@ class environment extends plugin var $uid = ""; var $is_group = false; + var $view_logged = FALSE; /* Attribute definition */ @@ -235,14 +236,6 @@ class environment extends plugin $this->gotoShareSelections= $config->getShareList(true); $this->gotoAvailableShares= $config->getShareList(false); - if($this->is_account){ - - if(in_array("gosaAccount",$this->attrs['objectClass'])){ - @log::log("view","users/".get_class($this),$this->dn); - }else{ - @log::log("view","groups/".get_class($this),$this->dn); - } - } } @@ -263,6 +256,15 @@ class environment extends plugin { /* Call parent execute */ plugin::execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + if(in_array("gosaAccount",$this->attrs['objectClass'])){ + @log::log("view","users/".get_class($this),$this->dn); + }else{ + @log::log("view","groups/".get_class($this),$this->dn); + } + } /* Are we editing from MyAccount and not editing a user */ $WriteOnly = (!isset($this->parent)|| !$this->parent) && !isset($_SESSION['edit']); diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 193143566..e4b953d70 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -85,6 +85,8 @@ class user extends plugin var $last_pw_storage= "unset"; var $had_userCertificate= FALSE; + var $view_logged = FALSE; + /* attribute list for save action */ var $attributes= array("sn", "givenName", "uid", "personalTitle", "academicTitle", "homePostalAddress", "homePhone", "labeledURI", "ou", "o", "dateOfBirth", "gender","preferredLanguage", @@ -136,8 +138,6 @@ class user extends plugin /* Create me for new accounts */ if ($dn == "new"){ $this->is_account= TRUE; - }else{ - @log::log("view","users/".get_class($this),$this->dn); } /* Make hash default to md5 if not set in config */ @@ -217,6 +217,12 @@ class user extends plugin /* Call parent execute */ plugin::execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","users/".get_class($this),$this->dn); + } + $smarty= get_smarty(); /* Fill calendar */ diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 0221fd4e0..b8af3484a 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -26,6 +26,7 @@ class mailAccount extends plugin /* CLI vars */ var $gosaVacationStart = 0; var $gosaVacationStop = 0; + var $view_logged = FALSE; /* plugin specific values */ var $mail = ""; @@ -198,11 +199,6 @@ class mailAccount extends plugin "regex" => "*"); register_global("mailfilter", $mailfilter); } - - /* Add "view" to logging class */ - if($this->is_account){ - @log::log("view","users/".get_class($this),$this->dn); - } } @@ -232,6 +228,12 @@ class mailAccount extends plugin /* Call parent execute */ plugin::execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","users/".get_class($this),$this->dn); + } + /* Initialise vars */ /* Load templating engine */ diff --git a/plugins/personal/nagios/class_nagiosAccount.inc b/plugins/personal/nagios/class_nagiosAccount.inc index 0e0a09d47..a01b4a87b 100644 --- a/plugins/personal/nagios/class_nagiosAccount.inc +++ b/plugins/personal/nagios/class_nagiosAccount.inc @@ -60,6 +60,7 @@ class nagiosAccount extends plugin var $objectclasses= array("nagiosContact","nagiosAuth"); var $uid = ""; + var $view_logged = FALSE; /* constructor, if 'dn' is set, the node loads the given 'dn' from LDAP */ @@ -77,10 +78,6 @@ class nagiosAccount extends plugin /* Save initial account state */ $this->initially_was_account= $this->is_account; - - if($this->is_account){ - @log::log("view","users/".get_class($this),$this->dn); - } } function execute() @@ -88,6 +85,12 @@ class nagiosAccount extends plugin /* Call parent execute */ plugin::execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","users/".get_class($this),$this->dn); + } + /* Load templating engine */ $smarty= get_smarty(); $display= ""; diff --git a/plugins/personal/netatalk/class_netatalk.inc b/plugins/personal/netatalk/class_netatalk.inc index 4d772a8c2..f1ed25a34 100644 --- a/plugins/personal/netatalk/class_netatalk.inc +++ b/plugins/personal/netatalk/class_netatalk.inc @@ -40,6 +40,7 @@ class netatalk extends plugin { var $cli_summary = "Manage netatalk account"; var $cli_description = "Manage Account \nfor netatalk"; var $cli_parameters = array ("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); + var $view_logged = FALSE; /* Plugin specific values */ var $apple_user_homepath_raw = ""; @@ -102,10 +103,6 @@ class netatalk extends plugin { /* Save initial account state */ $this->initially_was_account = $this->is_account; - - if($this->is_account){ - @log::log("view","users/".get_class($this),$this->dn); - } } @@ -157,6 +154,12 @@ class netatalk extends plugin { { plugin :: execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","users/".get_class($this),$this->dn); + } + /* Use the smarty templating engine here... */ $smarty = get_smarty(); $display = ""; diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index f8068ce63..31cbc42de 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -65,6 +65,8 @@ class posixAccount extends plugin var $GroupUserRegex = "*"; var $SubSearch = false; + var $view_logged = FALSE; + /* attribute list for save action */ var $CopyPasteVars = array("grouplist","groupMembership","use_shadowMin", @@ -96,10 +98,6 @@ class posixAccount extends plugin $ldap= $this->config->get_ldap_link(); - if($this->is_account){ - @log::log("view","users/".get_class($this),$this->dn); - } - if ($dn != NULL){ /* Correct is_account. shadowAccount is not required. */ @@ -229,6 +227,12 @@ class posixAccount extends plugin plugin::execute(); $display= ""; + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","users/".get_class($this),$this->dn); + } + /* Department has changed? */ if(isset($_POST['depselect'])){ $_SESSION['CurrentMainBase']= validate($_POST['depselect']); diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index c9b266719..ad90cce5d 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -23,6 +23,7 @@ class sambaAccount extends plugin /* Definitions */ var $plHeadline= "Samba"; var $plDescription= "This does something"; + var $view_logged = FALSE; /* CLI vars */ var $cli_summary= "Manage users samba account"; @@ -188,16 +189,18 @@ class sambaAccount extends plugin /* Save initial account state */ $this->initially_was_account= $this->is_account; - - if($this->is_account){ - @log::log("view","users/".get_class($this),$this->dn); - } } function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","users/".get_class($this),$this->dn); + } /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ -- 2.30.2