Code

Keep base if baseMode is false
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Aug 2009 13:01:56 +0000 (13:01 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Aug 2009 13:01:56 +0000 (13:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14142 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index 65f039181d9aabf94a95e3322292573167227438..156cc7b80ef8d44756f5f5517d45a64cd22b587d 100644 (file)
@@ -64,11 +64,15 @@ class listing {
     }
 
     // Set base for filter
-    $this->base= session::global_get("CurrentMainBase");
-    if ($this->base == null) {
+    if ($this->baseMode) {
+      $this->base= session::global_get("CurrentMainBase");
+      if ($this->base == null) {
+        $this->base= $config->current['BASE'];
+      }
+      $this->refreshBasesList();
+    } else {
       $this->base= $config->current['BASE'];
     }
-    $this->refreshBasesList();
 
     // Move footer information
     $this->showFooter= ($config->get_cfg_value("listSummary") == "true");
@@ -426,7 +430,7 @@ class listing {
     }
 
     // Save base
-    if (isset($_POST['BASE']) && $this->baseMode == true) {
+    if (isset($_POST['BASE']) && $this->baseMode) {
       $base= validate($_POST['BASE']);
       if (isset($this->bases[$base])) {
         $this->base= $base;
@@ -589,6 +593,10 @@ class listing {
 
   function renderBase()
   {
+    if (!$this->baseMode) {
+      return;
+    }
+
     $result= "<select name='BASE' onChange='mainform.submit()' size='1'>";
     $firstDN= null;
     $found= false;