1
dragonfl
quick question.
  • 2004/2/25 12:44

  • dragonfl

  • Just popping in

  • Posts: 16

  • Since: 2003/10/6


Currently I am developing some proprietary modules for my site, and have a question.

is there a way to check for membership in a certain group?

such as having a special button only a member of the leaders group would see.

forgive me if this is posted on the wrong forum.


Thanks
Drag

2
dragonfl
Re: quick question.
  • 2004/2/25 20:50

  • dragonfl

  • Just popping in

  • Posts: 16

  • Since: 2003/10/6


Wow I was hoping I would have got some sort of answer..

I was hoping there was actually a smarty variable that I could test to accomplish this..

if anyone could help it would be appreciated..

Drag

3
Mithrandir
Re: quick question.

Not in smarty, I believe - but if you are in the module files (not blocks) you can use the $xoopsUser->isAdmin($xoopsModule->getVar('mid')) to set a smarty variable like this:
$ismoduleadmin 0;
if (
$xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
    
$ismoduleadmin 1;
}
$xoopsTpl->assign('moduleadmin'$ismoduleadmin);

Then you can use it in the smarty template.

4
dragonfl
Re: quick question.
  • 2004/2/25 21:29

  • dragonfl

  • Just popping in

  • Posts: 16

  • Since: 2003/10/6


I am not looking to see if the intended user is an admin or not, I am only looking to find out if he belongs to a certain group. and if he does belong to the group then display a button or whatever, but only members of that group would see the information..


oh and thanks for your response..

Drag

5
Mithrandir
Re: quick question.

Right - forget my own head next

$xoopsUser->getGroups() fetches the groups a user belongs to, which you can search through for the one, you particularly want to give extra access.

If this is a more full-fletched solution, you are making, I'd recommend that you look into the Group Permissions features.

6
dragonfl
Re: quick question.
  • 2004/2/26 13:54

  • dragonfl

  • Just popping in

  • Posts: 16

  • Since: 2003/10/6


tThanks for your help, that command with the in_array() command I was able to check for the group I was looking for..

Drag

Login

Who's Online

125 user(s) are online (84 user(s) are browsing Support Forums)


Members: 0


Guests: 125


more...

Donat-O-Meter

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

Latest GitHub Commits