[LiveUser] Administrating users/groups
| From: | Jan Tammen | Date: | Sun, 11 Jan 2004 15:06:43 +0000 |
| Subject: | [LiveUser] Administrating users/groups | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-10113@lists.php.net to get a copy of this message | ||
Bonjour.
Since the people working on the LiveUser frontend seem to be rather
busy ;-), I'm in the need to get up my own scripts to manage user accounts / groups.
Basically I want to be able to manage user-group-relationships, thats all.
The included Admin-classes seem to provide everything I need.
But let's say I got a mask for updating an user account and I want to
change the user's group-membership (e.g. I got a html-select-field with the available
groups) -- would I first need to remove the user from all groups he is member of and
then adding him to the one(s) I selected?
I only found the methods addUserToGroup and removeUserFromGroup in the class
LiveUser_Admin_Perm_Container_DB_Complex. Wouldn't it be nice to have some kind of
wrapper-method which would put the user into the desired groups and removes all other
memberships?
sth. like (dummy-code)
function assignUserToGroups(integer $auth_user_id, array $group_ids)
{
removeUserFromAllGroups($auth_user_id);
foreach ($group_ids AS $group) {
addUserToGroup($auth_user_id, $group_id);
}
}
Or am I missing the point and there is already such a functionality?
Merci, Jan.