From: hickert Date: Tue, 22 May 2007 09:26:57 +0000 (+0000) Subject: Fixed logging X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b977131e22a35e3d9fb10cb08a7678127d6c186a;p=gosa.git Fixed logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6433 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 22d218511..ef4308c47 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -21,6 +21,7 @@ class componentGeneric extends plugin var $attributes= array("cn", "description"); var $objectclasses= array("top", "device", "ipHost", "ieee802Device"); var $netConfigDNS; + var $view_logged = FALSE; function componentgeneric ($config, $dn= NULL, $parent= NULL) { @@ -37,16 +38,18 @@ class componentGeneric extends plugin $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true); /* Save dn for later references */ $this->orig_dn= $this->dn; - - if($this->is_account){ - @log::log("view","component/".get_class($this),$this->dn); - } } + function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","component/".get_class($this),$this->dn); + } /* Do we represent a valid phone? */ if (!$this->is_account && $this->parent == NULL){ diff --git a/plugins/admin/systems/class_glpiAccount.inc b/plugins/admin/systems/class_glpiAccount.inc index 937323083..03e5712db 100644 --- a/plugins/admin/systems/class_glpiAccount.inc +++ b/plugins/admin/systems/class_glpiAccount.inc @@ -39,6 +39,7 @@ class glpiAccount extends plugin var $renameTypeDialog = false; var $renameOSDialog = false; var $select_type ; + var $view_logged = FALSE; /* Not necessary, cause we use mysql databse */ var $objectclasses= array("whatever"); @@ -111,10 +112,6 @@ class glpiAccount extends plugin $this->name = $this->dn; $this->orig_dn = $this->dn; $this->initially_was_account = $this->is_account; - - if($this->is_account){ - @log::log("view","undefined/".get_class($this),$this->dn); - } } function execute() @@ -122,6 +119,11 @@ class glpiAccount extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","all/".get_class($this),$this->dn); + } + /* Fill templating stuff */ $smarty= get_smarty(); $display= ""; diff --git a/plugins/admin/systems/class_glpiPrinterAccount.inc b/plugins/admin/systems/class_glpiPrinterAccount.inc index fb8ce7e49..dd69e2301 100644 --- a/plugins/admin/systems/class_glpiPrinterAccount.inc +++ b/plugins/admin/systems/class_glpiPrinterAccount.inc @@ -66,6 +66,8 @@ class glpiPrinterAccount extends plugin var $usedAttachments = array(); // Used Attachments var $usedCartridges = array(); // Used Cartridges + var $view_logged = FALSE; + /* Contructor Sets default values and checks if we already have an existing glpi account */ @@ -125,10 +127,6 @@ class glpiPrinterAccount extends plugin $this->name = $this->dn; $this->orig_dn = $this->dn; $this->initially_was_account = $this->is_account; - - if($this->is_account){ - @log::log("view","printer/".get_class($this),$this->dn); - } } function execute() @@ -136,6 +134,11 @@ class glpiPrinterAccount extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","printer/".get_class($this),$this->dn); + } + /* Fill templating stuff */ $smarty= get_smarty(); $display= ""; diff --git a/plugins/admin/systems/class_goCupsServer.inc b/plugins/admin/systems/class_goCupsServer.inc index 62a15a9f3..b5d282a01 100644 --- a/plugins/admin/systems/class_goCupsServer.inc +++ b/plugins/admin/systems/class_goCupsServer.inc @@ -21,6 +21,7 @@ class goCupsServer extends goService{ var $acl; var $cn = ""; var $goCupsServerStatus = ""; + var $view_logged =FALSE; function goCupsServer($config,$dn) { @@ -31,6 +32,11 @@ class goCupsServer extends goService{ function execute() { + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + $smarty = get_smarty(); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); diff --git a/plugins/admin/systems/class_goFaxServer.inc b/plugins/admin/systems/class_goFaxServer.inc index f5628c108..c791b6eb8 100644 --- a/plugins/admin/systems/class_goFaxServer.inc +++ b/plugins/admin/systems/class_goFaxServer.inc @@ -24,6 +24,7 @@ class goFaxServer extends goService { var $goFaxPassword = ""; var $goFaxServerStatus = ""; var $cn = ""; + var $view_logged =FALSE; function goFaxServer($config,$dn) { @@ -36,6 +37,11 @@ class goFaxServer extends goService { { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* Assign acls */ $tmp = $this->plInfo(); foreach($tmp['plProvidedAcls'] as $name => $translation ){ diff --git a/plugins/admin/systems/class_goFonServer.inc b/plugins/admin/systems/class_goFonServer.inc index 37f4b8ac9..7457444c8 100644 --- a/plugins/admin/systems/class_goFonServer.inc +++ b/plugins/admin/systems/class_goFonServer.inc @@ -26,6 +26,7 @@ class goFonServer extends goService{ var $goFonAdmin = ""; var $goFonAreaCode = ""; var $goFonCountryCode = ""; + var $view_logged =FALSE; function goFonServer($config,$dn) @@ -37,6 +38,11 @@ class goFonServer extends goService{ function execute() { + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + $smarty = get_smarty(); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); diff --git a/plugins/admin/systems/class_goGlpiServer.inc b/plugins/admin/systems/class_goGlpiServer.inc index 152ed03d3..ec35b1f24 100644 --- a/plugins/admin/systems/class_goGlpiServer.inc +++ b/plugins/admin/systems/class_goGlpiServer.inc @@ -25,6 +25,7 @@ class goGlpiServer extends goService { var $goGlpiAdmin =""; var $goGlpiDatabase =""; var $goGlpiPassword =""; + var $view_logged =FALSE; function goGlpiServer($config,$dn) @@ -36,6 +37,11 @@ class goGlpiServer extends goService { function execute() { + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + $smarty = get_smarty(); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); diff --git a/plugins/admin/systems/class_goImapServer.inc b/plugins/admin/systems/class_goImapServer.inc index 95d5d87dc..d08972ca7 100644 --- a/plugins/admin/systems/class_goImapServer.inc +++ b/plugins/admin/systems/class_goImapServer.inc @@ -37,6 +37,7 @@ class goImapServer extends goService { var $cyrusPop3 = false; var $cyrusPop3SSL = false; var $is_account = false; + var $view_logged =FALSE; var $acl; @@ -59,7 +60,12 @@ class goImapServer extends goService { function execute() { $smarty = get_smarty(); - + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* set new status */ if(isset($_POST['ExecAction'])){ if(isset($this->Actions[$_POST['action']])){ diff --git a/plugins/admin/systems/class_goKrbServer.inc b/plugins/admin/systems/class_goKrbServer.inc index edcc58f0f..51802b1cd 100644 --- a/plugins/admin/systems/class_goKrbServer.inc +++ b/plugins/admin/systems/class_goKrbServer.inc @@ -23,6 +23,7 @@ class goKrbServer extends goService{ var $goKrbRealm = ""; var $goKrbAdmin = ""; var $goKrbPassword =""; + var $view_logged =FALSE; function goKrbServer($config,$dn) { @@ -35,6 +36,11 @@ class goKrbServer extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".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/systems/class_goLdapServer.inc b/plugins/admin/systems/class_goLdapServer.inc index f4b2dccf2..b8d151ee3 100644 --- a/plugins/admin/systems/class_goLdapServer.inc +++ b/plugins/admin/systems/class_goLdapServer.inc @@ -21,6 +21,7 @@ class goLdapServer extends goService{ var $cn = ""; var $goLdapServerStatus = ""; var $goLdapBase = ""; + var $view_logged =FALSE; function goLdapServer($config,$dn) { @@ -31,6 +32,12 @@ class goLdapServer extends goService{ function execute() { + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + $smarty = get_smarty(); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); diff --git a/plugins/admin/systems/class_goLogDBServer.inc b/plugins/admin/systems/class_goLogDBServer.inc index 77ac6250c..a28990812 100644 --- a/plugins/admin/systems/class_goLogDBServer.inc +++ b/plugins/admin/systems/class_goLogDBServer.inc @@ -22,6 +22,7 @@ class goLogDBServer extends goService{ var $goLogDBServerStatus = ""; var $goLogAdmin = ""; var $goLogPassword = ""; + var $view_logged =FALSE; function goLogDBServer($config,$dn) @@ -35,6 +36,11 @@ class goLogDBServer extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".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/systems/class_goMailServer.inc b/plugins/admin/systems/class_goMailServer.inc index 0e28173b0..25d2fd827 100644 --- a/plugins/admin/systems/class_goMailServer.inc +++ b/plugins/admin/systems/class_goMailServer.inc @@ -39,6 +39,7 @@ class goMailServer extends goService{ var $Actions = array(); var $cn = ""; var $conflicts = array("goMailServer","kolab"); + var $view_logged =FALSE; function goMailServer($config,$dn) { @@ -192,6 +193,11 @@ class goMailServer extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".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/systems/class_goNtpServer.inc b/plugins/admin/systems/class_goNtpServer.inc index d64c45d2c..26434eefb 100644 --- a/plugins/admin/systems/class_goNtpServer.inc +++ b/plugins/admin/systems/class_goNtpServer.inc @@ -22,6 +22,7 @@ class goNtpServer extends goService{ var $goNtpServerStatus= ""; var $acl; var $cn = ""; + var $view_logged =FALSE; function goNtpServer($config,$dn) { @@ -43,6 +44,11 @@ class goNtpServer extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* Here we add a new entry */ if(isset($_POST['NewNTPAdd']) && $_POST['NewNTPExport'] != "" && $this->acl_is_writeable("goTimeSource")) { $this->goTimeSource[$_POST['NewNTPExport']]= $_POST['NewNTPExport']; diff --git a/plugins/admin/systems/class_goService.inc b/plugins/admin/systems/class_goService.inc index a73ff751e..bf4b63bcb 100644 --- a/plugins/admin/systems/class_goService.inc +++ b/plugins/admin/systems/class_goService.inc @@ -16,6 +16,7 @@ class goService extends plugin{ var $dn = NULL; var $cn = ""; var $DisplayName = ""; + var $view_logged =FALSE; /* Construcktion */ @@ -23,16 +24,17 @@ class goService extends plugin{ { plugin::plugin($config,$dn); $this->DisplayName = _("Empty service"); - - if($this->is_account){ - @log::log("view","server/".get_class($this),$this->dn); - } } /* Create content */ function execute() { + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + $str ="
". "  ". " ". diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc index 11ed781ba..18f9d747b 100644 --- a/plugins/admin/systems/class_goShareServer.inc +++ b/plugins/admin/systems/class_goShareServer.inc @@ -24,6 +24,7 @@ class goShareServer extends goService{ var $allow_mounts = false; var $mounts_to_remove = array(); var $mounts_to_add = array(); + var $view_logged =FALSE; function goShareServer($config,$dn) { @@ -54,6 +55,11 @@ class goShareServer extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList'])) && ($this->acl_is_writeable("name"))){ if($this->allow_mounts){ diff --git a/plugins/admin/systems/class_goSpamServer.inc b/plugins/admin/systems/class_goSpamServer.inc index a7cb30dce..55781fbba 100644 --- a/plugins/admin/systems/class_goSpamServer.inc +++ b/plugins/admin/systems/class_goSpamServer.inc @@ -41,6 +41,7 @@ class gospamserver extends goService{ var $dialog = NULL; var $ui = NULL; var $acl = NULL; + var $view_logged =FALSE; function gospamserver($config,$dn, $parent= NULL) { @@ -88,6 +89,11 @@ class gospamserver extends goService{ $display =""; $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* If displayed, it is ever true*/ $this->is_account =true; diff --git a/plugins/admin/systems/class_goSpamServerRule.inc b/plugins/admin/systems/class_goSpamServerRule.inc index 178269534..2adc6886e 100644 --- a/plugins/admin/systems/class_goSpamServerRule.inc +++ b/plugins/admin/systems/class_goSpamServerRule.inc @@ -6,6 +6,7 @@ class goSpamServerRule extends plugin { var $rule = ""; var $orig_name = ""; + var $view_logged =FALSE; function goSpamServerRule($config,$dn,$name = "",$rule ="") { @@ -18,6 +19,12 @@ class goSpamServerRule extends plugin { function execute() { $smarty = get_smarty(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); } diff --git a/plugins/admin/systems/class_goSyslogServer.inc b/plugins/admin/systems/class_goSyslogServer.inc index 382d594f0..4c242a329 100644 --- a/plugins/admin/systems/class_goSyslogServer.inc +++ b/plugins/admin/systems/class_goSyslogServer.inc @@ -21,6 +21,7 @@ class goSyslogServer extends goService{ var $acl; var $cn = ""; var $goSyslogServerStatus = ""; + var $view_logged =FALSE; function goSyslogServer($config,$dn) { @@ -31,6 +32,12 @@ class goSyslogServer extends goService{ function execute() { + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + + $smarty = get_smarty(); return($smarty->fetch(get_template_path("goSyslogServer.tpl",TRUE,dirname(__FILE__)))); } diff --git a/plugins/admin/systems/class_goTerminalServer.inc b/plugins/admin/systems/class_goTerminalServer.inc index 1b1eeecf5..d6afed9fa 100644 --- a/plugins/admin/systems/class_goTerminalServer.inc +++ b/plugins/admin/systems/class_goTerminalServer.inc @@ -23,6 +23,7 @@ class goTerminalServer extends goService{ var $goTerminalServerStatus = ""; var $goXdmcpIsEnabled = false; var $goFontPath = ""; + var $view_logged =FALSE; function goTerminalServer($config,$dn) @@ -35,6 +36,12 @@ class goTerminalServer extends goService{ function execute() { $smarty = get_smarty(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + $tmp = $this->plinfo(); foreach($tmp['plProvidedAcls'] as $name => $translation){ diff --git a/plugins/admin/systems/class_goVirusServer.inc b/plugins/admin/systems/class_goVirusServer.inc index a469988f8..287f915d5 100644 --- a/plugins/admin/systems/class_goVirusServer.inc +++ b/plugins/admin/systems/class_goVirusServer.inc @@ -39,6 +39,7 @@ class govirusserver extends goService{ var $avUser = ""; var $avHttpProxyURL = ""; var $avDatabaseMirror = ""; + var $view_logged =FALSE; function govirusserver($config,$dn, $parent= NULL) { @@ -63,6 +64,12 @@ class govirusserver extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + + /* Set acls */ $tmp = $this->plInfo(); foreach($tmp['plProvidedAcls'] as $name => $translation) { diff --git a/plugins/admin/systems/class_gosaLogServer.inc b/plugins/admin/systems/class_gosaLogServer.inc index 8bd11cc1b..6bb2b60ce 100644 --- a/plugins/admin/systems/class_gosaLogServer.inc +++ b/plugins/admin/systems/class_gosaLogServer.inc @@ -19,6 +19,7 @@ class gosaLogServer extends goService{ var $goLogDBUser = ""; var $goLogDBPassword = ""; var $goLogDB = ""; + var $view_logged =FALSE; function gosaLogServer($config,$dn) @@ -32,6 +33,11 @@ class gosaLogServer extends goService{ { $smarty = get_smarty(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".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/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 7b55449d9..aa78ad9e0 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -32,6 +32,7 @@ class phoneGeneric extends plugin var $goFonMSN = ""; var $selected_categorie = 0; var $netConfigDNS; + var $view_logged = FALSE; /* attribute list for save action */ var $attributes= array("cn", "description", @@ -92,10 +93,6 @@ class phoneGeneric extends plugin /* Save dn for later references */ $this->orig_dn= $this->dn; - - if($this->is_account){ - @log::log("view","phone/".get_class($this),$this->dn); - } } function set_acl_base($base) @@ -113,8 +110,13 @@ class phoneGeneric extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","phone/".get_class($this),$this->dn); + } /* Do we represent a valid phone? */ if (!$this->is_account && $this->parent == NULL){ diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 132e5667b..52ae6e345 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -49,7 +49,7 @@ class printgeneric extends plugin var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","gotoUserPrinter", "macAddress", "gotoUserAdminPrinter","gotoGroupAdminPrinter","gotoUserPrinter","gotoGroupPrinter"); var $objectclasses = array("top", "gotoPrinter"); - + var $view_logged = FALSE; var $parent; function printgeneric ($config, $dn,$parent_init,$parent) @@ -151,10 +151,6 @@ class printgeneric extends plugin } } } - - if($this->is_account){ - @log::log("view","printer/".get_class($this),$this->dn); - } } function set_acl_base($base) @@ -257,6 +253,12 @@ class printgeneric extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","printer/".get_class($this),$this->dn); + } + + /* If type of printer couldn't be detected (because of missing parent object in construction) * hide this tab. */ diff --git a/plugins/admin/systems/class_servDHCP.inc b/plugins/admin/systems/class_servDHCP.inc index 7796dc720..5f04fbbf1 100644 --- a/plugins/admin/systems/class_servDHCP.inc +++ b/plugins/admin/systems/class_servDHCP.inc @@ -11,20 +11,22 @@ class servdhcp extends plugin var $ignore_account= TRUE; var $attributes= array(); var $objectclasses= array("whatever"); + var $view_logged = FALSE; function servdhcp ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); - - if($this->is_account){ - @log::log("view","unknown/".get_class($this),$this->dn); - } } function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } /* Fill templating stuff */ $smarty= get_smarty(); diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index c32ac192d..485eede2b 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -26,6 +26,7 @@ class servdns extends goService var $conflicts = array("servdns"); var $DisplayName = ""; var $StatusFlag = ""; + var $view_logged = FALSE; function servdns ($config, $dn= NULL, $parent= NULL) { @@ -50,11 +51,6 @@ class servdns extends goService }else{ $this->is_account = true; } - - if($this->is_account){ - @log::log("view","unknown/".get_class($this),$this->dn); - } - $this->initially_was_account = $this->is_account; } @@ -65,6 +61,11 @@ class servdns extends goService */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* Fill templating stuff */ $smarty= get_smarty(); diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index 4fa00a01a..a9e93f5a5 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -38,6 +38,7 @@ class servgeneric extends plugin "sysinfo" => "sysinfo"); var $fai_activated =FALSE; + var $view_logged = FALSE; function servgeneric ($config, $dn= NULL, $parent= NULL) { @@ -64,10 +65,6 @@ class servgeneric extends plugin $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); $this->netConfigDNS->set_acl_category("server"); $this->netConfigDNS->set_acl_base($this->base); - - if($this->is_account){ - @log::log("view","server/".get_class($this),$this->dn); - } /* Save dn for later references */ $this->orig_dn= $this->dn; @@ -93,6 +90,11 @@ class servgeneric extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* Do we represent a valid server? */ if (!$this->is_account && $this->parent == NULL){ $display= "\"\" ". diff --git a/plugins/admin/systems/class_servKolab.inc b/plugins/admin/systems/class_servKolab.inc index 3b666fd43..5941bbc68 100644 --- a/plugins/admin/systems/class_servKolab.inc +++ b/plugins/admin/systems/class_servKolab.inc @@ -29,6 +29,7 @@ class servkolab extends goService { var $apache_http = "TRUE"; var $kolabHost = array(); var $orig_cn = ""; + var $view_logged = FALSE; var $attributes = array("postfix_mydomain", "postfix_mydestination", "proftpd_ftp", "k", "postfix_mynetworks", "postfix_enable_virus_scan", "postfix_relayhost", "apache_http", @@ -76,10 +77,6 @@ class servkolab extends goService { $this->initially_was_account = true; } } - - if($this->is_account){ - @log::log("view","server/".get_class($this),$this->dn); - } } @@ -88,6 +85,11 @@ class servkolab extends goService { /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /*************** Variable initialisation ***************/ diff --git a/plugins/admin/systems/class_servNfs.inc b/plugins/admin/systems/class_servNfs.inc index c7b05c362..15d15f68b 100644 --- a/plugins/admin/systems/class_servNfs.inc +++ b/plugins/admin/systems/class_servNfs.inc @@ -28,6 +28,7 @@ class servnfs extends plugin var $create_mount = false; //save mount entry var $parent = NULL; + var $view_logged = FALSE; function servnfs ($config, $parent,$entry= false,$mount =false) { @@ -83,6 +84,11 @@ class servnfs extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + /* Fill templating stuff */ $smarty= get_smarty(); diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc index 740fdf0ea..27bb610f7 100644 --- a/plugins/admin/systems/class_servRepository.inc +++ b/plugins/admin/systems/class_servRepository.inc @@ -26,7 +26,8 @@ class servrepository extends goService var $conflicts = array("FAIrepositoryServer"); var $DisplayName = ""; var $StatusFlag = ""; - + + var $view_logged = FALSE; var $fai_activated = FALSE; function servrepository ($config, $dn= NULL, $parent= NULL) @@ -83,10 +84,6 @@ class servrepository extends goService $this->repositories[$tmp[2]]=$tmp2; } } - - if($this->is_account){ - @log::log("view","server/".get_class($this),$this->dn); - } } function execute() @@ -94,6 +91,11 @@ class servrepository extends goService /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","server/".get_class($this),$this->dn); + } + if(!$this->fai_activated){ $str = "

"._("You can't use this plugin until FAI is activated.")."

"; return $str; diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 51aa620be..312b6f6cd 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -56,6 +56,7 @@ class termgeneric extends plugin "sysinfo" => "sysinfo"); var $fai_activated = FALSE; + var $view_logged = FALSE; function termgeneric ($config, $dn= NULL, $parent= NULL) { @@ -124,10 +125,6 @@ class termgeneric extends plugin } $this->orig_dn= $this->dn; - - if($this->is_account){ - @log::log("view","terminal/".get_class($this),$this->dn); - } } function set_acl_base($base) @@ -147,6 +144,11 @@ class termgeneric extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","terminal/".get_class($this),$this->dn); + } + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ $this->is_account= !$this->is_account; diff --git a/plugins/admin/systems/class_terminalInfo.inc b/plugins/admin/systems/class_terminalInfo.inc index 984c456ad..ae731aec9 100644 --- a/plugins/admin/systems/class_terminalInfo.inc +++ b/plugins/admin/systems/class_terminalInfo.inc @@ -25,6 +25,7 @@ class terminfo extends plugin /* Needed values and lists */ var $base= ""; var $cn= ""; + var $view_logged = FALSE; /* attribute list for save action */ var $ignore_account= TRUE; @@ -61,6 +62,11 @@ class terminfo extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","terminal/".get_class($this),$this->dn); + } + /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent == NULL){ echo "\"\" ". diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 2be95df79..25751532b 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -31,6 +31,7 @@ class termservice extends plugin var $goFonHardware= "automatic"; var $AutoSync = false; + var $view_logged = FALSE; /* Needed values and lists */ var $ignore_account= TRUE; @@ -243,16 +244,17 @@ class termservice extends plugin $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync); $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync); } - - if($this->is_account){ - @log::log("view","terminal/".get_class($this),$this->dn); - } } function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","terminal/".get_class($this),$this->dn); + } /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index dfae30147..7c4533480 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -26,6 +26,7 @@ class termstartup extends plugin /* attribute list for save action */ var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters","gotoModules"); var $objectclasses= array("GOhard"); + var $view_logged = FALSE; /* Helper */ var $customParameters= ""; @@ -144,10 +145,6 @@ class termstartup extends plugin } } } - - if($this->is_account){ - @log::log("view","terminal/".get_class($this),$this->dn); - } } function execute() @@ -155,6 +152,11 @@ class termstartup extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","terminal/".get_class($this),$this->dn); + } + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ $this->is_account= !$this->is_account; diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index fef7254f8..020256dd2 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -44,6 +44,7 @@ class wingeneric extends plugin "sambaNTPassword","sambaPwdLastSet","sambaAcctFlags"); var $objectclasses= array("posixAccount","person","organizationalPerson","inetOrgPerson","gosaAccount","shadowAccount","sambaSamAccount","top"); + var $view_logged = FALSE; function wingeneric ($config, $dn= NULL, $parent= NULL) { @@ -62,10 +63,6 @@ class wingeneric extends plugin $this->orig_dn= $this->dn; $this->cn= preg_replace("/\\\$\$/","",$this->cn); - - if($this->is_account){ - @log::log("view","winworkstation/".get_class($this),$this->dn); - } } @@ -84,8 +81,14 @@ class wingeneric extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","winworkstation/".get_class($this),$this->dn); + } + /* Do we represent a valid phone? */ if (!$this->is_account && $this->parent == NULL){ diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 4604c98a7..d28d106bc 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -28,6 +28,7 @@ class workgeneric extends plugin var $FAIscript= ""; var $didAction= FALSE; var $FAIstate= ""; + var $view_logged = FALSE; /* Needed values and lists */ var $base= ""; @@ -127,10 +128,6 @@ class workgeneric extends plugin $this->gotoSyslogServers[$server] = $visible; } - if($this->is_account){ - @log::log("view","workstation/".get_class($this),$this->dn); - } - /* Save 'dn' for later referal */ $this->orig_dn= $this->dn; } @@ -153,6 +150,11 @@ class workgeneric extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","workstation/".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/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index 1eed7b906..370253fbe 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -24,6 +24,7 @@ class workservice extends plugin var $gotoScannerClients= ""; var $gotoScannerBackend= ""; var $goFonHardware= "automatic"; + var $view_logged = FALSE; /* Needed values and lists */ var $ignore_account= TRUE; @@ -234,10 +235,6 @@ class workservice extends plugin $this->MouseTypes= array('AUTO' => _("inherited")); $this->MousePorts= array('AUTO' => _("inherited")); } - - if($this->is_account){ - @log::log("view","workstation/".get_class($this),$this->dn); - } } function execute() @@ -245,6 +242,11 @@ class workservice extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","workstation/".get_class($this),$this->dn); + } + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ $this->is_account= !$this->is_account; diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 2fbda7048..4ce45768e 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -42,7 +42,7 @@ class workstartup extends plugin var $FAIdebianMirror = "auto"; var $unresolved_classes = array(); - + var $view_logged = FALSE; /* FAI class selection */ var $InheritedFAIclass = array(); @@ -367,10 +367,6 @@ class workstartup extends plugin if (!isset($this->gotoBootKernels['default-inherited']) && $this->gotoBootKernel == "default-inherited"){ $this->gotoBootKernel= "default"; } - - if($this->is_account){ - @log::log("view","workstation/".get_class($this),$this->dn); - } } @@ -492,6 +488,11 @@ class workstartup extends plugin /* Call parent execute */ plugin::execute(); + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","workstation/".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()){