Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: bobdole2281 - elokuu 16, 2013, 02:45:12 IP

Otsikko: If user = admin
Kirjoitti: bobdole2281 - elokuu 16, 2013, 02:45:12 IP
I already have code to tell if a user is signed in. Is there a way to tell if the user is an admin?
Otsikko: Re: If user = admin
Kirjoitti: 4Kstore - elokuu 16, 2013, 02:46:36 IP
globalize $context and then use $context['user']['is_admin']
Otsikko: Re: If user = admin
Kirjoitti: Arantor - elokuu 16, 2013, 02:49:18 IP
That won't always work depending on where the code in question is - if it's in SSI or using the API, that won't work...

So what code is being used?