From a3c91b2acb68095f78896812d8a588adccc97d69 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 17 Oct 2006 05:18:40 +0000 Subject: [PATCH] Added subsearch filter git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4886 594d385d-05f5-0310-b6e9-bd551577e9d8 --- Changelog | 1 + plugins/admin/ogroups/class_ogroup.inc | 16 ++++++++++++---- plugins/admin/ogroups/ogroup_objects.tpl | 4 ++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index be8449c26..13644928e 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ GOsa2 changelog =============== * gosa 2.5.5 + - Added subsearch checkbox to ogroup->add filter - Fixed missing ppd configuration error, for newly created printer. - Fixed object group saving, the base was sometimes broken. - Fixed saving of terminal attribute gotoLpdEnable diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index b500e73f6..7da3f5282 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -71,6 +71,7 @@ class ogroup extends plugin "W" => "workstations", "T" => "terminals", "F" => "phones", + "_" => "subtrees", "P" => "printers") as $key => $val){ if (preg_match("/$key/", $this->gosaGroupObjects)){ @@ -228,7 +229,7 @@ class ogroup extends plugin } if (isset($_POST['dselect'])){ foreach( array("accounts", "groups", "applications", "departments", - "servers", "workstations", "terminals", "printers", + "servers", "workstations", "terminals", "printers","subtrees", "phones") as $type){ if (isset($_POST[$type])) { @@ -258,7 +259,7 @@ class ogroup extends plugin $smarty->assign("deplist", $this->config->idepartments); $smarty->assign("alphabet", generate_alphabet()); foreach( array("dselect", "regex", "accounts", "groups", "applications", - "departments", "servers", "workstations", "terminals", + "departments", "servers", "workstations", "terminals","subtrees", "printers", "phones") as $type){ $smarty->assign("$type", $ogfilter[$type]); } @@ -412,8 +413,15 @@ class ogroup extends plugin /* Perform search for selected objectClasses */ foreach($objectClasses as $class=> $basedn){ - $ldap->ls("(&(objectClass=".$class.")(|(uid=$regex)(cn=$regex)(ou=$regex)))",$basedn.$ogfilter['dselect'] , - array("dn", "cn", "description", "objectClass", "sn", "givenName", "uid","ou")); + + if($ogfilter['subtrees'] == "checked"){ + $ldap->cd($ogfilter['dselect']); + $ldap->search("(&(objectClass=".$class.")(|(uid=$regex)(cn=$regex)(ou=$regex)))", + array("dn", "cn", "description", "objectClass", "sn", "givenName", "uid","ou")); + }else{ + $ldap->ls("(&(objectClass=".$class.")(|(uid=$regex)(cn=$regex)(ou=$regex)))",$basedn.$ogfilter['dselect'] , + array("dn", "cn", "description", "objectClass", "sn", "givenName", "uid","ou")); + } /* fetch results and append them to the list */ while($attrs = $ldap->fetch()){ diff --git a/plugins/admin/ogroups/ogroup_objects.tpl b/plugins/admin/ogroups/ogroup_objects.tpl index cf248fe78..fc5f158a1 100644 --- a/plugins/admin/ogroups/ogroup_objects.tpl +++ b/plugins/admin/ogroups/ogroup_objects.tpl @@ -34,6 +34,10 @@ {t}Show printers{/t}
{t}Show phones{/t}

+

+ {t}Ignore subtrees{/t}
+

+