Code

Primary group filter changed, primary groups won't be listed anymore if box not checked
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Jun 2005 06:53:40 +0000 (06:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Jun 2005 06:53:40 +0000 (06:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@908 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupManagement.inc

index 43b7497a6966190f8a5f7c669f15241a940cea7e..113fd9c6a46ef73361a71f399ab88891f953ab2f 100644 (file)
@@ -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);
   }