Auth and user permission levels
| From: | olinux | Date: | Wed, 05 Feb 2003 20:18:09 +0000 |
| Subject: | Auth and user permission levels | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3613@lists.php.net to get a copy of this message | ||
I'd like to use Auth for allowing access to different
sections website (not porn) such as:
Paid Members only
Free Registration only
Free access (no auth required)
and then Admin levels for all of these in my content
manager app. Structure something like this
TABLE users
user_id | username | password | bla
TABLE groups
group_id | group_name
TABLE user_groups
user_id | group_id | is_confirmed
I'm thinking of using setAuthData to store array of
"group" id's that user can access.
SELECT * FROM user_groups
WHERE user_id = $user_id AND is_confirmed=1
Then make array of these groups to store with
setAuthData.
Then after I check for authentication do another check
to see that group they have valid access to the group.
if (in_array('2',$data))
{
/* group 2 user only content goes here */
}
Thanks much,
olinux
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com