From: hickert Date: Thu, 30 Jun 2005 06:53:40 +0000 (+0000) Subject: Primary group filter changed, primary groups won't be listed anymore if box not checked X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1ab4d85626157fa03518ee5f277695e2f1b71c23;p=gosa.git 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 --- 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); }