Code

Added some logging
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 13:22:47 +0000 (13:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 13:22:47 +0000 (13:22 +0000)
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
plugins/admin/applications/class_divListApplication.inc
plugins/admin/departments/class_divListDepartment.inc
plugins/admin/fai/class_divListFai.inc
plugins/admin/groups/class_divListGroup.inc
plugins/admin/groups/class_groupApplication.inc
plugins/admin/groups/class_groupGeneric.inc
plugins/admin/groups/class_groupMail.inc
plugins/admin/mimetypes/class_divListMimeTypes.inc
plugins/admin/ogroups/class_divListOGroup.inc
plugins/admin/systems/class_divListSystem.inc

index 59020e39288d745818919cf8c8487b750291f0b8..b20002053bf91002ae2391e378b00307497ccc5c 100644 (file)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index b43500a87c81a7457422c17c2cef53756012378d..d667b7cac9e41a9a753e9ae4ba6c92142bcac3c1 100755 (executable)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index 356fc8dbcd9e7f3b835fb69114c829bb9e6b44e4..c3a59151906c925885b8f3cc8d0416205c2cd143 100755 (executable)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index 4a68f3ecbf90c6458d60a5a55a432c3b4efedd5c..6bbc8b9c45e1433dcd0f9461b248272d0c072c94 100644 (file)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index 09d3ffa02cd0e92bafd72c57fb842566a159e81b..c578000169845f00249a249bb405d52529b35531 100644 (file)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index b66f40e85ddb5c5ea2e86062735be8bc845e06d0..2aa2e1aed4dd6e8ffa18f2bfda669ae9c4a58f8a 100644 (file)
@@ -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']); 
index aa5ed9884a639f4df59d1188a36a8f49eee1bfb9..75d3f4218634d47801d33e946380ff9f907c952c 100644 (file)
@@ -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= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
         _("This 'dn' is no group.")."</b>";
index 3c9b0feffb369c1ad201a6771a7b58cd39a4edf0..e3dd2ebac465b396fb7f46d8158ae13a0cecb303 100644 (file)
@@ -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();
 
index 243bff57e92918d9c60bf56c381786f9dac8542b..6ee3469aef97d478c14906eb33a75a1ad365378f 100755 (executable)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index 878c9d326549eae53577df4d707d29a13986d6ec..32276f8969df7250911423ed45cde8cc7f08a3d3 100755 (executable)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index b2f297e4bd5e6b9844086b20b0df19e9cecbefb4..f7b1ffac7af94d12f5d095a0cba0ba3f17112d96 100644 (file)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
 
+
     /* The currently used base is not visible with your acl setup.
      * Set base to first useable base.
      */