From 83bf4784d9c121ae787dd9b266a24ae2f56c7b83 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 23 May 2007 07:00:45 +0000 Subject: [PATCH] Added subtree search to selectUserToPrinter git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6442 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_selectUserToPrinterDialog.inc | 10 ++++++++-- plugins/admin/systems/selectUserToPrinterDialog.tpl | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/admin/systems/class_selectUserToPrinterDialog.inc b/plugins/admin/systems/class_selectUserToPrinterDialog.inc index e601e8745..3469979c2 100644 --- a/plugins/admin/systems/class_selectUserToPrinterDialog.inc +++ b/plugins/admin/systems/class_selectUserToPrinterDialog.inc @@ -8,6 +8,7 @@ class selectUserToPrinterDialog extends plugin var $attributes = array(); var $objectclasses = array("whatever"); var $regex = "*"; + var $subtree = FALSE; var $depselect = "/"; var $deplist = "/"; @@ -65,6 +66,7 @@ class selectUserToPrinterDialog extends plugin $this->regex=$_POST['regexPrinter']; $this->depselect = $_POST['depselectPrinter']; } + $this->subtree= isset($_POST['SubSearch']); if((isset($_GET['search']))&&(!empty($_GET['search']))){ $this->regex=$_GET['search']."*"; @@ -85,6 +87,7 @@ class selectUserToPrinterDialog extends plugin $smarty->assign("infoimage" , get_template_path('images/info.png')); $smarty->assign("launchimage" , get_template_path('images/small_filter.png')); $smarty->assign("deplist" , $this->config->idepartments); + $smarty->assign("subtree", $this->subtree?"checked":""); $display.= $smarty->fetch(get_template_path('selectUserToPrinterDialog.tpl', TRUE,dirname(__FILE__))); return($display); @@ -120,8 +123,11 @@ class selectUserToPrinterDialog extends plugin $a_return=array(); $ldap = $this->config->get_ldap_link(); $ldap->cd($this->depselect); - #$ldap->search("(&".$this->searchObjects."(cn=".$this->regex."))", $this->depselect, $this->searchAttrs); - $ldap->ls("(&".$this->searchObjects."(cn=".$this->regex."))", $this->baseAddition.$this->depselect, $this->searchAttrs); + if ($this->subtree){ + $ldap->search("(&".$this->searchObjects."(cn=".$this->regex."))", $this->searchAttrs); + } else { + $ldap->ls("(&".$this->searchObjects."(cn=".$this->regex."))", $this->baseAddition.$this->depselect, $this->searchAttrs); + } while($printer = $ldap->fetch()){ if(($detailed ==true)){ if(isset($printer[$this->searchAppend])){ diff --git a/plugins/admin/systems/selectUserToPrinterDialog.tpl b/plugins/admin/systems/selectUserToPrinterDialog.tpl index 0d387ef4d..5cd8e152a 100644 --- a/plugins/admin/systems/selectUserToPrinterDialog.tpl +++ b/plugins/admin/systems/selectUserToPrinterDialog.tpl @@ -25,6 +25,13 @@ {$alphabet}
+ + + + +
+  {t}Ignore subtrees{/t} +
-- 2.30.2