Calendar Permissions
 
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_calsnails
View previous topic :: View next topic  
Author Message
remhed
Starter
Starter


Joined: 04 Sep 2003
Posts: 3

PostPosted: Thu Sep 04, 2003 3:07 am    Post subject: Calendar Permissions Reply with quote

In the base WebSnail's callite (i.e. outside of MX) it is possible to set the user calendar permissions exclusive of the phpBB permissions. After installing the CalSnail module in MX, it looks like that feature is gone. Am I correct?

My goal is to allow users to modify calendar entries made by others, but not allow them to modify forum entries made by others. By giving the user the Admin setting for the calendar and User setting for the forum, this accomplished this goal. Is there a way to do this in MX without having to modify tons of code?

Does the other calendar module allow you to do this?

Thanks!

-Steve
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Sep 04, 2003 12:03 pm    Post subject: Re: Calendar Permissions Reply with quote

remhed wrote:
In the base WebSnail's callite (i.e. outside of MX) it is possible to set the user calendar permissions exclusive of the phpBB permissions. After installing the CalSnail module in MX, it looks like that feature is gone. Am I correct?

Afirmative. mx_calsnails is more plug'n'play (if you want).

I was thinking a lot about this, just read (first page of) mx_calsnalis thread at mx-system:
http://www.mx-system.com/forum/viewtopic.php?t=1892

To summarize, original CalLite permission settings were:
- allow_anon: View Yes/No.
- allow_user_default: No public access, View Only, View/Suggest Events, View/Add Events, View/Add/EditDeleteOwn.
- phpBB/admin/admin_ug_auth.php mod required to implement group permissions management.

Trying to simplify module installation, I removed the group permissions management, but I modded Martin's admin settings, to use allow_anon with the same options available to allow_user_default.

So, mx_calsnails permission settings are:
- allow_anon: No public access (default), View Only, View/Suggest Events, View/Add Events, View/Add/EditDeleteOwn.
- allow_user_default: No public access, View Only (default), View/Suggest Events, View/Add Events, View/Add/EditDeleteOwn.
- No phpBB mod required -> No group permissions available.


remhed wrote:
My goal is to allow users to modify calendar entries made by others, but not allow them to modify forum entries made by others. By giving the user the Admin setting for the calendar and User setting for the forum, this accomplished this goal. Is there a way to do this in MX without having to modify tons of code?

As you can figure out, mx_calsnails permissions are completely different thing that forum permissions.

To allow users with View/Add/EditDeleteOwn permission modify any calendar event, search function modify_marked() in calendar.php script, then find:
Code:
if ($caluser == 5 || $userdata['user_id'] == $row['user_id'])

and replace with:
Code:
if (1) // ($caluser == 5 || $userdata['user_id'] == $row['user_id'])

ie. make it always true ...and comment out old condition.

I'm not sure, but I believe it works and it may suit your needs.


remhed wrote:
Does the other calendar module allow you to do this?

Not sure, you have to try it. I believe it's based on MX-Block permissions.

Hope that helps.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
remhed
Starter
Starter


Joined: 04 Sep 2003
Posts: 3

PostPosted: Thu Sep 04, 2003 4:49 pm    Post subject: Re: Calendar Permissions Reply with quote

Thanks for looking into that for me!

I tried your suggestion, and the first time I tried to access the calendar I got an "unexpected T_ELSE" on line 751 of calendar.php. So I commented out the following:

Code:
      //else
      //{
      //message_die(GENERAL_ERROR, $lang['Cal_edit_own_event'], '', __LINE__, __FILE__, $sql);
      //}


I could then access the calendar. But, I still cannot edit entries by others. There is no link/icon for "Edit" available. This probably would require changes to the template? I don't want to waste a bunch of your time. If you are interested in figuring this out, I welcome the help. If not, I may just not use MX.

Thanks again,

Steve
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Sep 04, 2003 10:37 pm    Post subject: Re: Calendar Permissions Reply with quote

I'm sorry, I forgot that... :eusa_angel:
please, check out previous post. I have edited it to avoid your patch.


:eusa_think: hhmmm....

ok, open again calendar.php, scroll down to function display(), then find:
Code:
if ((($caluser >=4) && ($userdata['user_id']==$row['user_id'])) || ($caluser >=5)) {

Replace with:
Code:
if ($caluser >=4) {

...this change should allow any user to view the edit/delete buttons. But, we only want to allow edits. so....

Find:
Code:
$delpost_img = '<a href="' . this_mxurl('action=Delete_marked&id='.$row['id']) .'"><img src="' . PHPBB_URL.$images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';

Replace with:
Code:
if( ($userdata['user_id']==$row['user_id']) || ($caluser >=5) )
{
   $delpost_img = '<a href="' . this_mxurl('action=Delete_marked&id='.$row['id']) .'"><img src="' . PHPBB_URL.$images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
}


May be it works.

BTW, I hope these small changes help you figure out how to do it, using this module or even Martin's MOD. Why not?

Cheers

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
remhed
Starter
Starter


Joined: 04 Sep 2003
Posts: 3

PostPosted: Sun Sep 07, 2003 11:27 pm    Post subject: Re: Calendar Permissions Reply with quote

That worked!

Thanks for your patience. I am trying to learn this stuff!

-Steve
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Sep 08, 2003 12:03 am    Post subject: Re: Calendar Permissions Reply with quote

Great! Smile
 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_calsnails All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum