Code

Added SubSearch to posix group
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 May 2006 03:37:40 +0000 (03:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 May 2006 03:37:40 +0000 (03:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3436 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/posix/class_posixAccount.inc
plugins/personal/posix/posix_groups.tpl

index 2af3bc0fa1c2b4ee5d70ffe2102a0b9535da937c..b72840a3f6da714c7a64e5685f40bca7c8e7c3af 100644 (file)
@@ -64,6 +64,7 @@ class posixAccount extends plugin
 
   var $GroupRegex       = "*";
   var $GroupUserRegex   = "*";
+  var $SubSearch        = false;
 
   /* attribute list for save action */
   var $CopyPasteVars  = array("grouplist","groupMembership","use_shadowMin","use_shadowMax","use_shadowWarning","use_shadowInactive","use_shadowExpire","must_change_password","force_ids","printerList","grouplist","savedGidNumber","savedUidNumber","savedGroupMembership");
@@ -410,6 +411,12 @@ class posixAccount extends plugin
         }
       }
 
+      if($this->SubSearch){
+        $smarty->assign("SubSearchCHK"," checked ");
+      }else{
+        $smarty->assign("SubSearchCHK","");
+      }
+
       $smarty->assign("regex",$this->GroupRegex);
       $smarty->assign("guser",$this->GroupUserRegex);
       $smarty->assign("groups", $glist);
@@ -674,6 +681,13 @@ class posixAccount extends plugin
         }
       }
     }
+    if(isset($_POST["PosixGroupDialogPosted"])){
+      if(isset($_POST['SubSearch']) && ($_POST['SubSearch'])){
+        $this->SubSearch = true;
+      }else{
+        $this->SubSearch = false;
+      }
+    }
   }
 
 
@@ -1069,9 +1083,10 @@ class posixAccount extends plugin
 
     /* Set base for all searches */
     $base     = $_SESSION['CurrentMainBase'];
-    $base     = get_groups_ou().$base;
+    $base     = $base;
     $ldap     = $this->config->get_ldap_link();    
     $attrs    =  array("cn", "description", "gidNumber");
+    $Flags    = GL_SIZELIMIT;
 
     /* Get groups */
     if ($this->GroupUserRegex == '*'){
@@ -1079,7 +1094,14 @@ class posixAccount extends plugin
     } else {
       $filter= "(&(objectClass=posixGroup)(cn=".$this->GroupRegex.")(memberUid=".$this->GroupUserRegex."))";
     }
-    $res= get_list($filter, $this->ui->subtreeACL, $base,$attrs, GL_SIZELIMIT);
+    if($this->SubSearch){
+      $Flags |= GL_SUBSEARCH;
+    }else{
+      $base = get_groups_ou().$base;
+    }
+
+
+    $res= get_list($filter, $this->ui->subtreeACL, $base,$attrs, $Flags);
 
     /* check sizelimit */
     if (preg_match("/size limit/i", $ldap->error)){
index 3616545e80e0f2e3578ebaba9f77ffa77c3f97dd..ca3ae3ec5825979e2ced3e347b68fc9074a6cb6d 100644 (file)
@@ -25,6 +25,7 @@
                        <table summary="" style="width:100%;">
                                {$alphabet}
                        </table>
+
                                <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
                                        <tr>
                                                <td width="50%">
                                        </tr>
                                </table>
                                <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+                    <tr>
+                                               <td>
+                                                       <input type="checkbox" name="SubSearch" value="1" {$SubSearchCHK}
+                                                               onClick="mainform.submit();">
+                                                       {t}Ignore subtrees{/t}
+                                               </td>
+                                       </tr>
+                </table>
+                               <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
                                        <tr>
                                                <td width="50%">
                                                        <img alt="" src="{$search_image}" align=middle>&nbsp;{t}Display groups matching{/t}
@@ -64,7 +74,7 @@
                </td>
        </tr>
 </table>
-
+<input type="hidden" value="1" name="PosixGroupDialogPosted">
 <p class="plugbottom">
   <input type=submit name="add_groups_finish" value="{t}Add{/t}">
   &nbsp;