[dev] Groups patch

Carlos Pedrinaci cpedrinaci at yahoo.es
Fri Oct 28 08:46:14 PDT 2005


Hi,

The Group::listAllUsers function seemed to be buggy.
The root group was listed twice and the users were not obtained correctly 
because it was calling listUsers using the groupName and not the groupID.

Patch attached.

-- Carlos
-------------- next part --------------
Index: Group.php
===================================================================
RCS file: /repository/framework/Group/Group.php,v
retrieving revision 1.85
diff -u -r1.85 Group.php
--- Group.php	13 Oct 2005 05:59:16 -0000	1.85
+++ Group.php	28 Oct 2005 15:41:03 -0000
@@ -369,10 +369,10 @@
             return $groups;
         }
 
-        $groups = array($group) + $groups;
         $users = array();
-        foreach ($groups as $group) {
-            $users = array_merge($users, $this->listUsers($group));
+        $groupIDs = array_keys($groups);
+        foreach ($groupIDs as $groupID) {
+            $users = array_merge($users, $this->listUsers($groupID));
         }
         return array_values(array_flip(array_flip($users)));
     }


More information about the dev mailing list