From ab3872f95d12860c395e29675890f19ac6c6a1d9 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 19 May 2006 03:37:40 +0000 Subject: [PATCH] Added SubSearch to posix group git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3436 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/posix/class_posixAccount.inc | 26 +++++++++++++++++-- plugins/personal/posix/posix_groups.tpl | 12 ++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 2af3bc0fa..b72840a3f 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -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)){ diff --git a/plugins/personal/posix/posix_groups.tpl b/plugins/personal/posix/posix_groups.tpl index 3616545e8..ca3ae3ec5 100644 --- a/plugins/personal/posix/posix_groups.tpl +++ b/plugins/personal/posix/posix_groups.tpl @@ -25,6 +25,7 @@ {$alphabet}
+
@@ -38,6 +39,15 @@
+ + + +
+ + {t}Ignore subtrees{/t} +
+
 {t}Display groups matching{/t} @@ -64,7 +74,7 @@
- +

  -- 2.30.2