1
cyph77
Can't get module admin rights to work
  • 2006/3/7 18:27

  • cyph77

  • Just popping in

  • Posts: 1

  • Since: 2006/3/7 1


I've created my own module but want only a certain group to have access to certain part of my module.

In the admininistrative section I've added a new Group called "Reservation admins" and gave them module admin rights to the reservation module i created.

In the code this is what I tried:

$module_id = $xoopsModule->getVar('mid');
if( $xoopsUser->isAdmin( $module_id ) )
{
//code
}

if( $xoopsUser->isAdmin( -1 ) )
{
//code
}

if( $xoopsUser->isAdmin( ) )
{
//code
}

I've checked the isAdmin function and the CheckRights functions and from what I see it should work. What am I doing wrong?

Thanks,
Martin

2
jlm69
Re: Can't get module admin rights to work
  • 2006/3/7 20:28

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


I'm not sure what you are trying to do, but if you download the jobs module version 2.2 (find it at http://www.jlmzone.com) and look in the addlisting.php file.

There you will see 2 different ways of doing it.

The first is at the top of the page, that allows users access to the page if they are in the right group.

The other is at about lines 177 to 185, this one allows certain groups to do one thing and others something else.

You should also look at the admin/groupperms.php file, I assume you have one like it in your module. you could just use the jobs one, just change the values to fit your module.

This is the easiest way for me to explain it.

remember if it is in a function you need

global $xoopsUser, $xoopsModule; plus what you already have there.

Hope this helps,

John

3
jlm69
Re: Can't get module admin rights to work
  • 2006/3/7 21:07

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


I'm not sure what you are trying to do, but if you download the jobs module version 2.22 (find it at http://www.jlmzone.com) and look in the addlisting.php file.

There you will see 2 different ways of doing it.

The first is at the top of the page, that allows users access to the page if they are in the right group.

The other is at about lines 177 to 185, this one allows certain groups to do one thing and others something else.

You should also look at the admin/groupperms.php file, I assume you have one like it in your module. you could just use the jobs one, just change the values to fit your module.

This is the easiest way for me to explain it.

remember if it is in a function you need

global $xoopsUser, $xoopsModule; plus what you already have there.

Hope this helps,

John

Login

Who's Online

305 user(s) are online (62 user(s) are browsing Support Forums)


Members: 0


Guests: 305


more...

Donat-O-Meter

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

Latest GitHub Commits