View Full Version : Calendar.php and permisions
Frank H. Shaw
12-26-2008, 06:51 PM
I have been trying to stop users when looking at a calendar to not see the events in the calendar if he does not have permisions - but to my surprise the permisions part does not seem to be working for me. I have version vBulletin® Version 3.6.8 and I go into the admin part and for the calendar - i set the custom permisions to the following:
Edit Calendar Permissions For Usergroup: York Rite Member in Calendar Capitular District - 2 - Reguler Meeting
Can View Calendar Yes
Everything else is No
What I want is only the user that have York Rite Member set in the
Additional Usergroups under Usergroup Options in the admin Control Panel which has the York Rite Member but in my test case to test to see if this feature is working - I have only the Blue Lodge Member set - so this user should not be able to view the events in the calendar but he can.
Can any one give me some insite on what is it that i might be doing wrong. If there is a bug - how can I create a modification so that it will work the way i need it too.
THANKS
Frank H. Shaw
Lynne
12-26-2008, 07:58 PM
Check the permissions under Calendars > Calendar Permissions
Frank H. Shaw
12-26-2008, 08:13 PM
The Permisions are set to this as explianed before:
Can View Calendar Yes
All other options set to No
But this is only
Edit Calendar Permissions For Usergroup: York Rite Member in Calendar Capitular District - 2 - Reguler Meeting
I tested this by having a user with the York Rite Member not set and the user could still see the events in the calendar Capitular District - 2 - Reguler Meeting
So there is a problem in the permisions system for calendars.
THANKS
Frank H. Shaw
Lynne
12-26-2008, 08:17 PM
If you don't want them to see the calendar (which includes seeing the events), you need to put Can View Calendar to No.
You need to check permissions in both Usergroup Manager > usergroup > Calendar Permissions and in Calendars > Calendar Permissions >
Frank H. Shaw
12-26-2008, 08:41 PM
Edit Calendar Permissions For Usergroup: Blue Lodge Member in Calendar Capitular District - 2 - Reguler Meeting
I set the Can View Calendar No
All other options set to No
But
Edit Calendar Permissions For Usergroup: York Rite Member in Calendar Capitular District - 2 - Reguler Meeting
I set the Can View Calendar Yes
All other options set to No
So what should happen is a user that has Blue Lodge Member set but does not have the York Rite Member set in the Admin Control Panel the point is the User should never be able to see {View the calendar or events in the Calendar - it would be ok to view the calendar and have no events showing - but the calendar shows all the events in the Calendar Capitular District - 2 - Reguler Meeting.
So my test case is failing.
What do I need to check ?
THANKS
Frank H. Shaw
Lynne
12-26-2008, 09:00 PM
When you talk about the permissions being set, I can't tell if you are talking about them being set under Usergroup Manager or under Calendar Permissions - I think you are talking about under Calendar > Calendar Permissions, but the category under Usergroups is also called Calendar Permissions so it's hard to tell which one you are talking about.
Are both of your usergroups Primary Usergroups for your users? So they are either in one or the other but there is no way for them to be in both?
Frank H. Shaw
12-26-2008, 09:38 PM
Edit Calendar Permissions For Usergroup: York Rite Member in Calendar Capitular District - 2 - Reguler Meeting
I set the Can View Calendar Yes
All other options set to No
Can View Calendar Yes
Is set in the following link:
http://www.yoursite.org/forums/admincp/index.php
Calendar Permissions Manager
Edit Calendar Permissions For Usergroup: Blue Lodge Member in Calendar Capitular District - 2 - Reguler Meeting
I set the Can View Calendar No
All other options set to No
But if the user is set in the Admin control panel
is only set for Blue Lodge Member but not York Rite Member. So the only one that should have access to the calendar to View is the User that has York Rite Member set.
This works just as it should in the FORUM part but does not seem to work the same in the calendar. WHY?
THANKS
Frank H. Shaw
Lynne
12-26-2008, 09:53 PM
That link is the index page for the admin cp. Both the permissions areas I am talking about are in the admin cp. What I am saying is the two areas are in admincalendar.php and usergroup.php and it's not clear which you are talking about.
Basically, the ones in admincalendar.php will override the ones in usergroup.php, so you need to make sure they are done in there. Also, are these primary or secondary usergroups?
Frank H. Shaw
12-26-2008, 10:20 PM
1. Additional Usergroups not Display usergroups not secondary usergroups??
Primary Usergroup is Registered Users
Display usergroups is Registered Users
Every member is a Blue Lodge Member but only some users are York Rite Member but the settings are only set in the secondary usergroups?
The main category in the Additional Usergroups is
Additional Usergroups this is where the :
York Rite Member
and
Blue Lodge Member
is set or unset
In the above case my test user has
Blue Lodge Member set
York Rite Member not set { because he is not a York Rite Member}
all works just fine for the forums but not in the calendar section.
The Calendar Permisons is where the
Calendar Permissions Manager
Edit Calendar Permissions For Usergroup: Blue Lodge Member in Calendar Capitular District - 2 - Reguler Meeting
I set the Can View Calendar No
All other options set to No
Edit Calendar Permissions For Usergroup: York Rite Member in Calendar Capitular District - 2 - Reguler Meeting
I set the Can View Calendar Yes
All other options set to No
THANKS
Frank H. Shaw
--------------- Added 26 Dec 2008 at 17:06 ---------------
The file calendar.php has three places that I would link to call your attension to:
the lines 485, 755, 795 have the similer script whichis the following:
eval('print_output("' . fetch_template('CALENDAR') . '");');
the part of code are the following:
Monthly View
Weekly View
Year View
I would like to only look at the montly View whichis the following:
Lynne edited out calendar.php code.....
Now here is the thing if I could test the permision on the user in the
York Rite Member
under the Additional Usergroups and if set allow this to happen the events in the calendar be displayed else if not set the calendar would come up with no events listed for that month. The calendar Calendar Capitular District - 2 - Reguler Meeting only has in the whole calendar York Rite Events.
So my question where is the part of the script that handles the output of the events that get showed up in the calendar when the calendar.php does the following:
eval('print_output("' . fetch_template('CALENDAR') . '");');
I hope this better explains what i am trying to do and why!
THANKS
Frank H. Shaw
Lynne
12-26-2008, 11:33 PM
Permissions work such that a Yes always trumps a No. So, if their primary usergroup is Registered Usergroup and that usergroup has Can View Calendar set to Yes, then it will be Yes no matter what the secondary usergroups say. So, you need to set it to No for all Registered users and then set it to Yes only for those you want to allow to view the calendar.
I removed all the default vbulletin code you posted - please see our General Site Rules (https://vborg.vbsupport.ru/info.php?do=rules):
Any copyrighted code snippets should be no more than 10 lines in length, unless approved by a member of Staff.
I really don't know much about changing the calendar.php page since I have never paid much attention to the calendar before (except to finally turn it on on my site a few months ago).
Frank H. Shaw
12-27-2008, 12:46 AM
The calendar jump is now displaying in the drop down the correct options according to the permison set York Rite Member - member will see the list calandars that are Blue Lodge and York Rite. This is exactly what I wanted to happen in the drop down but the events that are loaded in the calendar are not get displayed.
The calendar has no events in the calendar - this is not what i wanted to happen - I WANT THE EVENTS GOING ON FOR THE MONTH DISPLAYED IN THE CALENDAR. tHEY ARE THERE BUT NOT BEING DISPLAYED.
what i did to get the drop down to work was to set all the permisions on the Primary User Group Calendar permisions to all no. This fixed that part but the displaying of the events is not working. SO THAT IS THE ONLY PROBLEM LEFT NOW.
Here is the setting maybe it will help you.
Can View Calendar Yes
Can Post Events No
Can Edit Own Events No
Can Delete Own Events No
Can View Others' Events No
Posted Events are Not Moderated
So why is the actual events that I put in as a admin for the whole two years not showing up in the calendar.
What setting above is wrong?
Or is some thing else has to be done some where else?
THANKS
Frank H. Shaw
--------------- Added 1230348833 at 1230348833 ---------------
I Changed the Calendar Permisions for Can View Others' Events No to Yes. This and the other fix has solved all the issues around the calendar.
I will not have to make any changes to the calendar.php and templetes for the calendar every thing works as I wanted it to.
Thanks for all your help on this.
THANKS
Frank H. Shaw
Lynne
12-27-2008, 03:04 AM
Glad you got it all working as you want it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.