Code

Removed tripple $this->reload
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 May 2006 07:09:00 +0000 (07:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 May 2006 07:09:00 +0000 (07:09 +0000)
and prepared class to use subsearches

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3249 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_systemManagement.inc

index ad8910dd40bea4622894cc269d38c20cdf5267cf..8455a6a10c7b448e6fff01e13d523f3eaffd0bc1 100644 (file)
@@ -109,9 +109,6 @@ class systems extends plugin
       $s_entry  = $_GET['id'];
     }
 
-    /* Save Termfilter .... */
-    $this->reload();
-
     /* Check for exeeded sizelimit */
     if (($message= check_sizelimit()) != ""){
       return($message);
@@ -369,7 +366,6 @@ class systems extends plugin
         $this->systab= NULL;
 
         /* Terminal list has changed, reload it. */
-        $this->reload ();
       } else {
 
         /* Normally this shouldn't be reached, send some extra
@@ -438,9 +434,6 @@ class systems extends plugin
           del_lock ($this->dn);
         }
 
-        /* There's no page reload so we have to read new terminals at
-           this point. */
-        $this->reload ();
         unset ($this->systab);
         $this->systab= NULL;
         unset($_SESSION['objectinfo']);
@@ -490,6 +483,12 @@ class systems extends plugin
 
     /* Display dialog with system list */
     $this->DivListSystem->execute();
+
+    /* Add departments if subsearch is disabled */
+    if(!$this->DivListSystem->SubSearch){
+      $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase);
+    }
+    $this->reload();
     $this->DivListSystem->setEntries($this->terminals);
     return($this->DivListSystem->Draw());
   }
@@ -574,13 +573,20 @@ class systems extends plugin
 
     /* Walk through all possible search combinations, and search for some objects if the checkbox is enabled  */
     foreach($objs as $checkBox => $oc){
-
       if($this->DivListSystem->$checkBox){
-        /* User filter? */
-        if($oc['CLASS'] != ""){
-          $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
-          $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base,
-                array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE));
+        if($this->DivListSystem->SubSearch){
+          if($oc['CLASS'] != ""){
+            $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
+            $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $base,
+                  array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH));
+          }
+        }else{
+          /* User filter? */
+          if($oc['CLASS'] != ""){
+            $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
+            $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base,
+                  array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE));
+          }
         }
       } 
     }