Code

Only find adequat values
[gosa.git] / gosa-core / include / class_listing.inc
index 65f039181d9aabf94a95e3322292573167227438..0f3a8594e833e8a2a94e6507d5f91b6844c4e72e 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;
@@ -893,8 +901,8 @@ class listing {
 
   function getAction()
   {
-    // Do not do anything if this is not our PID
-    if(isset($_REQUEST['PID']) && $_REQUEST['PID'] != $this->pid) {
+    // Do not do anything if this is not our PID, or there's even no PID available...
+    if(!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid) {
       return;
     }
 
@@ -1159,7 +1167,7 @@ class listing {
       $attrs[]= $data['ATTR'];
     }
     $filter.= "))";
-    $res= get_list($filter, $this->module, $this->base, $attrs, GL_NONE | GL_SIZELIMIT);
+    $res= get_list($filter, $this->module, $this->base, $attrs, GL_NONE);
 
     // Analyze list of departments
     foreach ($res as $department) {