From f1e1a12a268756beb9cd8d06ac85934b92e651cb Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 May 2006 07:09:00 +0000 Subject: [PATCH] Removed tripple $this->reload and prepared class to use subsearches git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3249 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index ad8910dd4..8455a6a10 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -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)); + } } } } -- 2.30.2