MyBB Community Forums

Full Version: What's the best way to tell if user is logged in as ADMIN?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What's the best way to tell if user is logged in as ADMIN?

i need it for my manual code and site integration

Tanks
if($mybb->user['usergroup'] == 4) {
//do blah
}
$mybb->usergroup['cancp']
thanks to both of you,

ok so one more thing, how do i get this variable into my script? i checked out the cookie created but i see no variable set that indicates usergroup or even userid..

i do see sid <-- w/c seems to be a session id? is it? and is this the only way to get the usergroup data by via sid instead of uid?
You get it when you include MyBB's global.php. If you want to be independent, you'll have to look at the cookie first and then talk to the database to verify that the cookies are indeed correct. Basically what MyBB does in it's init / session
well, i might as well include global.php haha tnx much yo.. great help!