From 2d91eac69259c98cb5524f0a2734ff6a2b579ddd Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 30 Jun 2005 08:03:39 +0000 Subject: [PATCH] Reworked filter for primary groups to hide them explicitly when the "show primary groups" checkbox is disabled. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@910 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/groups/class_groupManagement.inc | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index 113fd9c6a..d9463cc1e 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -315,7 +315,6 @@ 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"){ @@ -324,26 +323,28 @@ class groupManagement extends plugin $filter.= "(gidNumber=$gidNumber)"; } $filter.= "))"; - }else{ - $filter.= "(&(objectClass=posixGroup)(&"; + } else { + $filter.= "(&(objectClass=posixGroup)(!(|"; foreach ($primaries as $gidNumber => $cn){ - $filter.= "(!gidNumber=$gidNumber)"; + $filter.= "(gidNumber=$gidNumber)"; } - $filter.= "))"; + $filter.= ")))"; } + /* Set filter depending on selection */ + $sfilter= ""; if ($groupfilter['appgroups'] == "checked"){ $filter.= "(objectClass=gosaApplicationGroup)"; } if ($this->config->current['SAMBAVERSION'] == 3){ - $sfilter= "(objectClass=sambaGroupMapping)"; - if ($groupfilter['sambagroups'] == "checked"){ + if ($groupfilter['primarygroups'] != "checked"){ + $sfilter= "(objectClass=sambaGroupMapping)"; + } elseif ($groupfilter['sambagroups'] == "checked"){ $filter.= "(objectClass=sambaGroupMapping)"; } - } else { - $sfilter= ""; } + if ($groupfilter['mailgroups'] == "checked"){ $filter.= "(objectClass=gosaMailAccount)"; } @@ -390,12 +391,6 @@ class groupManagement extends plugin } } - if($groupfilter['primarygroups']!="checked"){ - foreach($primarie as $rm ){ - unset($this->grouplist[$rm]); - } - } - natcasesort ($this->grouplist); reset ($this->grouplist); } -- 2.30.2