Code

Readded roomNumber update
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Oct 2006 04:20:07 +0000 (04:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Oct 2006 04:20:07 +0000 (04:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4885 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_ogroup.inc
plugins/admin/ogroups/ogroup_objects.tpl

index 8d5c5b3ee4e93a0991ae1898dfacfd0d157663b6..03174fbd579e6f7dfa7fb4509bf5ba7e140e133b 100644 (file)
@@ -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)){
@@ -238,7 +239,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])) {
@@ -268,7 +269,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]);
       }
@@ -411,8 +412,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()){
index cf248fe7819a6334b28956d0f69d8a1d38d2a695..fc5f158a16e062611d8246e40592af7b3c581f42 100644 (file)
     <input type=checkbox name="printers" value="1" {$printers} onClick="mainform.submit()" title="{t}Select to see printers{/t}">{t}Show printers{/t}<br>
     <input type=checkbox name="phones" value="1" {$phones} onClick="mainform.submit()" title="{t}Select to see phones{/t}">{t}Show phones{/t}<br>
  </p>
+ <p class="contentboxb" style="border-top:1px solid #B0B0B0; background-color:#F8F8F8">
+    <input type=checkbox name="subtrees" value="1" {$subtrees} onClick="mainform.submit()" title="{t}Select to search within subtrees{/t}">{t}Ignore subtrees{/t}<br>
+ </p>
+
     <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8"><tr><td width="50%"><img alt="" src="{$tree_image}" align=middle title="{t}Display objects of department{/t}">&nbsp;
     <select name="dselect" size=1 onChange="mainform.submit()" title="{t}Choose the department the search will be based on{/t}">
       {html_options options=$deplist selected=$dselect}