On 5 Mar 2005, at 17:08, Ren=E9 C. Kiesler wrote:
>
> =A0
> does anyone have advice on how I'd select all users of a certain group=20=
> efficiently? I'd need the user_ids, so I can join them with the rest.
listMembers() function in mod/users/class/Group.php would seem to=20
already do what you're after.
It's always better to address the objects directly via their class=20
functions than to try and mess with the data directly as you'd be in=20
danger of your module breaking if the base classes changed how they=20
stored their data.
=46rom mod/users/docs/devdoc.txt...
PHPWS_User($user_id) : creates a user object with that user's data.
PHPWS_User_Groups($group_id) : Group object constructor
isDeity([$user_id]) : Returns TRUE if the user is a Deity. Without the=20=
user_id, the current
logged user will be used.
checkPassword($pass1, $pass2) : performs error checking on two=20
passwords. Returns an
array of error messages or NULL if the passwords will work.
getUserId($username) : returns the user_id of a particular username
getUserName ($user_id) : returns the username of a particular user_id
isUser : returns TRUE if the current user has an account.
getGroupname($group_id) : returns group name of group_id
userInGroup($group_id[, $user_id]) : returns TRUE if the user is in the=20=
group designated
by the group_id
listUserGroups([$user_id]) : returns an array of groups that the user=20
is a member of. It is
indexed by the group id and the value is the name of the group.
listMembers($group_id) : returns an array of users in a particular=20
group. The array is indexed
by the user_id. The values of the array are the usernames.
listAllGroups() : returns an array of groups indexed by group_id.
listUserGroupVars($user_id, $module_title) : returns an array of group=20=
variables for a user.
The array is indexed by the group id and contains an array of the=20
variables and their values.
Shaun
aegis design - http://www.aegisdesign.co.uk
|