Posted on: 02/13/05 04:13am
By: Anonymous (Don)
I've got a (hopefully) quick question:
I'm using the MacIG plugin to allow a user to assign itself to a number of groups. Now, I'd like to make a static page which displays an editable text field for each group that the user is assigned to.
How would I go about determining what the user's ID and group membership is on the static page are so I can generate this edit page in php?
Determining a user's ID and group membership through a static page
Posted on: 02/13/05 04:40am
By: Dirk
[QUOTE BY= Don] How would I go about determining what the user's ID and group membership is on the static page are so I can generate this edit page in php?[/QUOTE]
The current user's uid is always available from the global variable $_USER['uid'] (although it may be empty for anonymous users).
Another global variable, $_GROUPS, holds an array of all the groups the current user is in.
Also see system/lib-security.php for a collection of handy functions for working with group membership and permissions.
bye, Dirk