From 1ab4d85626157fa03518ee5f277695e2f1b71c23 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 30 Jun 2005 06:53:40 +0000 Subject: [PATCH] Primary group filter changed, primary groups won't be listed anymore if box not checked git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@908 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_groupManagement.inc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index 43b7497a6..113fd9c6a 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -315,15 +315,23 @@ class groupManagement extends plugin $error= $ldap->error; while ($attrs= $ldap->fetch()){ $primaries[$attrs['gidNumber'][0]]= $attrs['cn'][0]; + $primarie[$attrs['dn']]= $attrs['cn'][0]; } + if ($groupfilter['primarygroups'] == "checked"){ $filter.= "(&(objectClass=posixGroup)(|"; foreach ($primaries as $gidNumber => $cn){ $filter.= "(gidNumber=$gidNumber)"; } $filter.= "))"; + }else{ + $filter.= "(&(objectClass=posixGroup)(&"; + foreach ($primaries as $gidNumber => $cn){ + $filter.= "(!gidNumber=$gidNumber)"; + } + $filter.= "))"; } - + /* Set filter depending on selection */ if ($groupfilter['appgroups'] == "checked"){ $filter.= "(objectClass=gosaApplicationGroup)"; @@ -381,6 +389,13 @@ class groupManagement extends plugin $this->grouplist[$value["dn"]]= $value["cn"][0]; } } + + if($groupfilter['primarygroups']!="checked"){ + foreach($primarie as $rm ){ + unset($this->grouplist[$rm]); + } + } + natcasesort ($this->grouplist); reset ($this->grouplist); } -- 2.30.2