1
eertl
isAdmin
  • 2004/5/4 22:39

  • eertl

  • Just popping in

  • Posts: 2

  • Since: 2004/5/4 2


Hi guys. I'm really new with XOOPS, and I've a question, maybe its too easy, but I can't figure out how to know if a user is Admin or not.
$xoopsUserIsAdmin and $xoopsUser->isAdmin() doesn't work for me, because they tell me if the user is Admin of the current module, but what I want to know is if the user is in the Admin group.
Right now, i'm using in_array(1, $xoopsUser->getGroups()), but i don't like this hardcoded value...
Anyone?

Sorry for my english...

2
Dave_L
Re: isAdmin
  • 2004/5/4 22:56

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


You could use:
in_array(XOOPS_GROUP_ADMIN$xoopsUser->getGroups())


XOOPS_GROUP_ADMIN is defined in mainfile.php.

You didn't say why you're doing this. Normally it's the admin right to the current module that's of interest.

3
eertl
Re: isAdmin
  • 2004/5/4 23:02

  • eertl

  • Just popping in

  • Posts: 2

  • Since: 2004/5/4 2


Thanks! That was fast!
The reason why I want to do that is 'cause I want to show to system administrators only, more information in the admin page of a module I'm developing.


Login

Who's Online

292 user(s) are online (80 user(s) are browsing Support Forums)


Members: 0


Guests: 292


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits