Admin - how to get the groups for a user?
Stacy Johnson <[email protected]> Mon, 05 Dec 2005 11:55:22 -0800
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm using the Perm_Medium admin class and trying to use getGroups to
come up with the groups for a user, but I'm a little stumped.
I am basically trying to create an "Edit user" type page for admins, and
I want to let them choose which group the user belongs to. I need to
show which group the user currently belongs to, which is what I am
having trouble with. Here is what I am looking at:
// Get group names/ids from DB for dropdown
$groups = $admin->perm->getGroups();
// Get the group that this user belongs
to (doesn't work)
$filters = array(
'perm_user_id' => $id
);
$usergroup =
$admin->perm->getGroups($filters);
I realize that the user and group mapping are in the separate table
usergroups (not groups), but I am wondering how I can filter on that
information?
thanks,
-stacy
--
Stacy Johnson
Ignite Analytics Corporation
[email protected]
m. 206-354-5591