1
solo71
How to automatically give anonymous access at module installation ?
  • 2005/6/21 17:51

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


I'm actually working on a new utility module, and just for easyness purpose, I need the anonymous group to be able to access this module.

I know the webmaster is supposed to give access to the anonymous group afterwards, but for the reason I don't need this module to have a main link access (and thus deactivated it on purpose), the option doesn't show up in the group admin system...

Hope this make sens for you?

So, here is my question : how can I set the module up, so that at install, the anonymous has access to the module?


2
Mithrandir
Re: How to automatically give anonymous access at module installation ?

onInstall function

xoops_module_install_moduledirname(&$module) {
    
$groupperm_handler =& xoops_gethandler('groupperm');
    return 
$groupperm_handler->addRight('module_read'$module->getVar('mid'), XOOPS_GROUP_ANONYMOUS);
}

3
solo71
Re: How to automatically give anonymous access at module installation ?
  • 2005/6/21 19:16

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


Oooh, thanks a lot Mithy. As usual, the right code for the right purpose...

Oh, and a precious doc: for onInstall and onUninstall to those who are going to read this topic.


4
Yoshi
Re: How to automatically give anonymous access at module installation ?
  • 2005/8/4 2:02

  • Yoshi

  • Just popping in

  • Posts: 8

  • Since: 2003/7/13


Hi,

I found this thread when I was looking for a clue to do the same thing, and tried what's written here and the tech doc linked from here, but it doesn't seem to work.

I have a feeling that my call to addRight function is denied for lack of permission?

Here's my install_func.php:

function xoops_module_install_xoopshp(&$module) {
    
$groupperm_handler =& xoops_gethandler('groupperm');
    return 
$groupperm_handler->addRight('module_read'$module->getVar('mid'), XOOPS_GROUP_ANONYMOUS);
}

5
rowdie
Re: How to automatically give anonymous access at module installation ?
  • 2005/8/4 5:13

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


post edited.

Ignore this, sorry.

6
Yoshi
Re: How to automatically give anonymous access at module installation ?
  • 2005/8/4 6:15

  • Yoshi

  • Just popping in

  • Posts: 8

  • Since: 2003/7/13


Hi rowdie,

I was just in time for your original post and tried it. It worked, and then came back here for a thank you post, and it was gone.

I wonder if it was for some security reason etc, but anyway, thank you for the help.

Best,

Yoshi

7
rowdie
Re: How to automatically give anonymous access at module installation ?
  • 2005/8/4 6:23

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


heh , that's good

I tried it too after posting here, and decided that it doesn't make sense When installing a module using XOOPS 2.2 you have to select the groups to give module permissions to... so I figured you couldn't have been using 2.2 and I didn't think my solution worked on earlier versions. Ah well...

For anyone intested, my original post involved adding the module directory name to the parameters.

function xoops_module_install_xoopshp(&$module) {
    
$groupperm_handler =& xoops_gethandler('groupperm', [color=CC0000]'xoopshp'[/color]);
    return 
$groupperm_handler->addRight('module_read'$module->getVar('mid'), XOOPS_GROUP_ANONYMOUS);
}

8
flupp
Re: How to automatically give anonymous access at module installation ?
  • 2005/9/26 10:43

  • flupp

  • Just popping in

  • Posts: 4

  • Since: 2005/8/30


As a beginner, I learned a lot from Mithrandir's post. However, (being convinced about the good OO- concepts of XOOPS, and hence wanting to get to know XOOPS better than now) I really lack well structured documentation (apart from the documentation gathered around from reading through the forum, e.g. the comparison.pdf that Mithrandir elsewhere mentioned). In this specific case, how, or where should I have found this 'onInstall' or 'onUninstall' feature ?

P.S. Up to now, I found the code browsing possibilities quite helpful in reading through the code. But maybe there are more structured docs to be found elsewhere (e.g. on the -detailed- concepts) ?

9
Dave_L
Re: How to automatically give anonymous access at module installation ?
  • 2005/9/26 11:12

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Quote:
In this specific case, how, or where should I have found this 'onInstall' or 'onUninstall' feature ?


It's described in the Dev Wiki, linked in the Main Menu at http://dev.xoops.org/. Within the Dev Wiki, see sections 3.3.1 and 4.3.

Login

Who's Online

281 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 281


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