Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:17 am EST
Geeklog Forums
Determining a user's ID and group membership through a static page
Don
Anonymous
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?
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?
9
12
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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?
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
12
9
Quote
All times are EST. The time is now 01:17 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content