Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

SMF sessions

Aloittaja liquid1002, tammikuu 15, 2007, 07:31:47 IP

« edellinen - seuraava »

liquid1002

How Would I use the SMF session system to verify if someone is an Administrator / Mod and so on... I tried to find some topics in the forums but I had no luck.. Thanks in advance.


Edit: I've done some more researching and found how to use the session management... But I'm unable to view content, Even If I am in the $user_info['ID_GROUP']

JayBachatero

What code are you currently using?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

liquid1002

sorry, I've been gone for the past few weeks.  at the moment I am using


if($user_info['is_admin']){
    print "Welcome Back dewd!";
}else{
    print "Test Error Message";
}


But I wanted to use like  if($user_info['GROUP_ID'] = 1) type of thing

JayBachatero

if (in_array(ID_OF_GROUP, $user_info['groups']))
{
        echo 'Hello';
}
else
{
        echo 'bye';
}
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

liquid1002

#4
Now with the $user_info['groups'] am I able to set that to specific groups (ie: admin/mods)?

Thanks again for the help you are providing.

Edit
I've managed to get it to work for one group... But I need it for multiple groups

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

liquid1002

That answers a lot of questions I would have had. Thanks for the link :)

Advertisement: