1
josespi
How do query to select admins?
  • 2008/10/3 23:01

  • josespi

  • Just popping in

  • Posts: 31

  • Since: 2004/11/29


I am learning php and developing a module in xoops.

I've searched in the forum, but I have not found the vars and fields needed to make a query within the module that I return the list of managers of the module. Or It tell me if the current user is an administrator of the module.

Thanks

2
ghia
Re: How do query to select admins?
  • 2008/10/6 12:49

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Every module has its own kind of preferences where user rights can be assigned. You should study the code for that module. For general admin rights, see modules/system/admin.php?fct=groups.
You should be cautious, to publicize this information.

3
josespi
Re: How do query to select admins?
  • 2008/10/6 18:44

  • josespi

  • Just popping in

  • Posts: 31

  • Since: 2004/11/29


Hello ghia:

Thanks ghia for your supported.

On the page that you point out, It apply admin rights to each group.

I'm rewriting integration between XOOPS with Gallery (http://gallery.menalto.com)

What I need to know is Who users belong to the group that has admin rights of the module that I´m creating? In order to pass this information to the Gallery.

4
ghia
Re: How do query to select admins?
  • 2008/10/7 2:36

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


if (is_object($xoopsUser)){
    
$xoopsModule XoopsModule::getByDirname('yourmoduledir');
    if(
$xoopsUser->isAdmin($xoopsModule->mid())) define('USER_IS_ADMIN'1);
    else 
define('USER_IS_ADMIN'0);
}

5
josespi
Re: How do query to select admins?
  • 2008/10/9 19:39

  • josespi

  • Just popping in

  • Posts: 31

  • Since: 2004/11/29


Hello ghia:

Thanks ghia newly for your supported.

But, I don´t need know if users es Admin or not. I need a script to have me of all admins to module.

I have researched to modules/system/admin.php?fct=groups but I didn´t found any solve.

José Espinoza


6
ghia
Re: How do query to select admins?
  • 2008/10/11 1:40

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The proposed script sets the USER_IS_ADMIN to 1 if the user has admin rights of the module identified by the directory name (yourmoduledir in the example, but to be replaced with the real directory name of your module).

If you want a list of all users with admin rights of your module, then you have to look up the the users group id (gperm_groupid) for your module id (gperm_modid) with 'module_admin' in the rights field (gperm_name) in table xoops_group_permission. Depending of the modules one or more item id's (eg. categories) may be present. All user id of this group id can then be found in table xoops_groups_users_link.


7
josespi
Re: How do query to select admins?
  • 2008/10/14 17:30

  • josespi

  • Just popping in

  • Posts: 31

  • Since: 2004/11/29


Thanks ghia. I think that I'll can do the script whit your inform.

Login

Who's Online

353 user(s) are online (243 user(s) are browsing Support Forums)


Members: 0


Guests: 353


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