phpBB User Levels

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Majoraslayer
Forum Commoner
Posts: 64
Joined: Thu Jun 30, 2005 11:50 am
Location: In Your Mind...
Contact:

phpBB User Levels

Post by Majoraslayer »

I posted this question on phpbb.com, but once again no one can help me. It should be a very simple question for anyone that knows how phpBB works, so I'll post it here as well. Thanks to anyone who can help!
Myself On phpbb.com wrote: I've managed to extend sessions outside of phpBB on my site thanks to the guide. Everything is working great. Now I need to know, how do I check the user level? I found the user level numbers once before, but what variable are they being assigned to? In other words, what variable do I check to check the user level (admin, mod, etc.)?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Here's how your admin/pagestart.php file checks:

Code: Select all

if (!$userdataї'session_logged_in'])
{
	redirect(append_sid(&quote;login.$phpEx?redirect=admin/&quote;, true));
}
else if ($userdataї'user_level'] != ADMIN)//IF they're not admin.
{
	message_die(GENERAL_MESSAGE, $langї'Not_admin']);
}
Hope that helps.
Majoraslayer
Forum Commoner
Posts: 64
Joined: Thu Jun 30, 2005 11:50 am
Location: In Your Mind...
Contact:

Post by Majoraslayer »

That tells me exactly what I needed to know. You rock neophyte, thanks for helping me out again!
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

No problem. Glad to help. :D
Post Reply