1
rickh
[Tinyevent] block anonymous users from submitting events
  • 2004/10/23 23:48

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


Hello,

By default everyone can submit events with this module (tinyevent), but I don't want anonymous users to do this. Is there a way to block this function for these users? I only want registered and admin users to add events.

I can't find it in the admin panel, so maybe I have to hack something in the code?

2
rickh
Re:[Tinyevent] block anonymous users from submitting events
  • 2004/10/24 18:21

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


ain't there a piece of 'standard' code or something I can use for this purpose?

i.e. something like: "if (user != registered) {exit;}" which I can add above the code of 'tiny event' submit.php ?

3
chapi
Re:[Tinyevent] block anonymous users from submitting events
  • 2004/10/24 19:04

  • chapi

  • Theme Designer

  • Posts: 611

  • Since: 2002/1/22


You can do the following. Open up xoops_version.php in your TinyEvent modules folder and search for the following part

// Menu
$modversion['hasMain'] = 1;
$modversion['sub'][1]['name'] = _MI_TE_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";

Edit it, that it looks like this.

// Menu
$modversion['hasMain'] = 1;
if (
is_object($xoopsUser)) {
  
$modversion['sub'][1]['name'] = _MI_TE_SMNAME1;
  
$modversion['sub'][1]['url'] = "submit.php";
}

After that only registered users should see the submit link.

4
dejadingo
Re:[Tinyevent] block anonymous users from submitting events
  • 2004/11/12 22:10

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


But $xoopsUser is not defined at this point.
I can't find exactly where it is defined, and I'm not sure if this is a good place to make it available.

Can this be pulled out separately as a block (or something)and still make it be subordinate to the main tinycontent menu item?

Thanks for your help.