From a55556288dcb9fd7ef67704102850a0419205f9c Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 21 May 2007 13:22:47 +0000 Subject: [PATCH] Added some logging Fixed several div list git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6425 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/acl/class_divListACL.inc | 32 ++++++++++------- .../applications/class_divListApplication.inc | 30 +++++++++------- .../departments/class_divListDepartment.inc | 26 ++++++++------ plugins/admin/fai/class_divListFai.inc | 26 +++++++++----- plugins/admin/groups/class_divListGroup.inc | 34 ++++++++++++------- .../admin/groups/class_groupApplication.inc | 11 +++--- plugins/admin/groups/class_groupGeneric.inc | 18 +++++----- plugins/admin/groups/class_groupMail.inc | 13 ++++--- .../mimetypes/class_divListMimeTypes.inc | 30 +++++++++------- plugins/admin/ogroups/class_divListOGroup.inc | 28 +++++++++------ plugins/admin/systems/class_divListSystem.inc | 30 +++++++++------- 11 files changed, 168 insertions(+), 110 deletions(-) diff --git a/plugins/admin/acl/class_divListACL.inc b/plugins/admin/acl/class_divListACL.inc index 59020e392..b20002053 100644 --- a/plugins/admin/acl/class_divListACL.inc +++ b/plugins/admin/acl/class_divListACL.inc @@ -76,16 +76,24 @@ class divListACL extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + /* Load possible departments */ - $ui = get_userinfo(); - $tdeps = $ui->get_module_departments("acl"); - $ids = $this->config->idepartments; - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + $ui= get_userinfo(); + $tdeps= $ui->get_module_departments("acl"); + $ids = $this->config->idepartments; + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ /* Keep first base dn in mind, we could need this * info if no valid base was found @@ -93,13 +101,13 @@ class divListACL extends MultiSelectWindow if(empty($first)) { $first = $dep['dn']; } - - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index b43500a87..d667b7cac 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -88,34 +88,38 @@ class divListApplication extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + /* Load possible departments */ $ui= get_userinfo(); $tdeps= $ui->get_module_departments("application"); + $ids = $this->config->idepartments; $first = ""; $found = FALSE; - $ids = $this->config->idepartments; - - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ - - $value = $ids[$dep['dn']]; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ /* Keep first base dn in mind, we could need this * info if no valid base was found */ if(empty($first)) { $first = $dep['dn']; - } - - if ($this->selectedBase == $dep['dn']){ + } + + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index 356fc8dbc..c3a591519 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -71,18 +71,24 @@ class divListDepartment extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + /* Load possible departments */ $ui= get_userinfo(); $tdeps= $ui->get_module_departments("department"); - $ids = $this->config->idepartments; - - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ /* Keep first base dn in mind, we could need this * info if no valid base was found @@ -91,12 +97,12 @@ class divListDepartment extends MultiSelectWindow $first = $dep['dn']; } - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 4a68f3ecb..6bbc8b9c4 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -112,16 +112,24 @@ class divListFai extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + /* Load possible departments */ $ui= get_userinfo(); $tdeps= $ui->get_module_departments("fai"); $ids = $this->config->idepartments; - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ /* Keep first base dn in mind, we could need this * info if no valid base was found @@ -129,13 +137,13 @@ class divListFai extends MultiSelectWindow if(empty($first)) { $first = $dep['dn']; } - - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index 09d3ffa02..c57800016 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -93,33 +93,41 @@ class divListGroup extends MultiSelectWindow $found = FALSE; $base = $this->config->current['BASE']; + + /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); - /* Load possible departments */ + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + + /* Load possible departments */ $ui= get_userinfo(); $tdeps= $ui->get_module_departments("groups"); - $ids = $this->config->idepartments; + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ - - /* Keep first base dn in mind, we could need this - * info if no valid base was found + /* Keep first base dn in mind, we could need this + * info if no valid base was found */ if(empty($first)) { $first = $dep['dn']; } - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index b66f40e85..2aa2e1aed 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -34,7 +34,7 @@ class appgroup extends plugin var $AllAppsForRelease = array(); var $AllAppsForReleaseParameter = array(); - + var $view_logged = FALSE; var $CopyPasteVars = array("Categories"); var $gosaApplicationParameter ; var $ui = NULL; @@ -157,9 +157,6 @@ class appgroup extends plugin $this->Releases = $this->getReleases(); } - if($this->is_account){ - @log::log("view","groups/".get_class($this),$this->dn); - } } @@ -385,6 +382,12 @@ class appgroup extends plugin /* Call parent execute */ plugin::execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","groups/".get_class($this),$this->dn); + } + /* Check if department was selected */ if((isset($_GET['act']))&&($_GET['act']=="depopen")){ $dep = base64_decode($_GET['depid']); diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index aa5ed9884..75d3f4218 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -40,7 +40,7 @@ class group extends plugin var $rfc2307bis= FALSE; var $OnlyShowFirstEntries =200; var $dnMapping= array(); - + var $view_logged = FALSE; var $allowGroupsWithSameNameInOtherSubtrees = true; /* attribute list for save action */ @@ -171,10 +171,6 @@ class group extends plugin $this->base =preg_replace ("/^[^,]+,".normalizePreg(get_groups_ou())."/","",$this->dn); } - if($this->dn != "new"){ - @log::log("view","groups/".get_class($this),$this->dn); - } - /* This is always an account */ $this->is_account= TRUE; $this->reload(); @@ -182,10 +178,16 @@ class group extends plugin 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","groups/".get_class($this),$this->dn); + } - /* Do we represent a valid group? */ + /* Do we represent a valid group? */ if (!$this->is_account && $this->parent == NULL){ $display= "\"\" ". _("This 'dn' is no group.").""; diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index 3c9b0feff..e3dd2ebac 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -48,6 +48,8 @@ class mailgroup extends plugin var $indexed_acl= array(); var $indexed_user= array(); + var $view_logged = FALSE; + /* attribute list for save action */ var $attributes= array( "mail", "gosaMailServer", "gosaMailQuota", "gosaMailMaxSize", "gosaMailAlternateAddress", "gosaMailForwardingAddress", @@ -62,7 +64,6 @@ class mailgroup extends plugin /* Initialise all available attributes ... if possible */ plugin::plugin($config, $dn); - $this->orig_cn = $this->cn; /* Set mailMethod to the one defined in gosa.conf @@ -292,10 +293,6 @@ class mailgroup extends plugin $this->perms["lrswipcd"]= _("write"); $this->perms["lrswipcda"]= _("admin"); $this->perms[""]= _("none"); - - if($this->is_account){ - @log::log("view","groups/".get_class($this),$this->dn); - } } function execute() @@ -303,6 +300,12 @@ class mailgroup extends plugin /* Call parent execute */ //plugin::execute(); + /* Log view */ + if($this->is_account && !$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","groups/".get_class($this),$this->dn); + } + /* Load templating engine */ $smarty= get_smarty(); diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc index 243bff57e..6ee3469ae 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -98,18 +98,24 @@ class divListMimeTypes extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + /* Load possible departments */ - $ui = get_userinfo(); + $ui= get_userinfo(); $tdeps= $ui->get_module_departments($this->module); - $ids = $this->config->idepartments; - - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ /* Keep first base dn in mind, we could need this * info if no valid base was found @@ -117,13 +123,13 @@ class divListMimeTypes extends MultiSelectWindow if(empty($first)) { $first = $dep['dn']; } - - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index 878c9d326..32276f896 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -98,18 +98,24 @@ class divListOGroup extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } + /* Load possible departments */ $ui= get_userinfo(); $tdeps= $ui->get_module_departments("ogroups"); - $ids = $this->config->idepartments; - - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ /* Keep first base dn in mind, we could need this * info if no valid base was found @@ -117,13 +123,13 @@ class divListOGroup extends MultiSelectWindow if(empty($first)) { $first = $dep['dn']; } - - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index b2f297e4b..f7b1ffac7 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -97,15 +97,15 @@ class divListSystem extends MultiSelectWindow $base = $this->config->current['BASE']; /* Add base */ - $deps[] = array("dn"=>$this->config->current['BASE']); - $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); - $tmp =array(); - foreach($deps as $dep){ - $tmp[$dep['dn']] = $dep; + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; } - $deps = $tmp; /* Load possible departments */ $ui= get_userinfo(); @@ -119,10 +119,13 @@ class divListSystem extends MultiSelectWindow } } + /* Load possible departments */ + $ui= get_userinfo(); $ids = $this->config->idepartments; - - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $departments)){ + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $departments)){ /* Keep first base dn in mind, we could need this * info if no valid base was found @@ -131,16 +134,17 @@ class divListSystem extends MultiSelectWindow $first = $dep['dn']; } - $value = $ids[$dep['dn']]; - if ($this->selectedBase == $dep['dn']){ + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ $found = TRUE; - $options.= ""; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } + /* The currently used base is not visible with your acl setup. * Set base to first useable base. */ -- 2.30.2