LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Problems / Problem with multiple calendars
Posted:  11 Jan 2015 01:20
Suppose I have two calendars - cal1 (the default) and cal2.

I open the first calendar: http://myserver/LuxCal/index.php?cal=cal1
I log in as admin, change some calendar settings, then I log out.
Then I open the second calendar in a new tab: http://myserver/LuxCal/index.php?cal=cal2. I am getting a "you are not authorized..." error message, and when I click "calendar", everything is okay until I click onthe navigation arrows where I am presented with the same error message. Back on the cal1 tab, when I click the navigation arrows, I suddenly find myself into cal2 as well, together with the error message.

I think the problem is that in the cookies (which are stored only once per url) the calendar ID is stored together with the username,  last used page and other stuff. Switching forth and back between calendars will not work until you delete your cookies.

Solution so far has been to have distinct directories per calendar as this will keep the cookies separate.

Possible workaround: upon logging out, delete all relevant cookies and sessions.

Regards, Ben
Posted:  11 Jan 2015 04:26
Addendum: I found the culprit, it's in index.php, Line 112ff:

//load last selected cP, cU, cP and cL
if ($set['restLastSel']) { loadLastSel($calID); } <-- There we load the last settings for the user. However, we only save them if the user is not the "public user". This way the public user will "inherit" some of the settings if we have been logged on as e.g. admin.

so it'd be wise to only reload saved settings if the user is not "public" (just as we do when we *save* the settings)

//load last selected cP, cU, cP and cL
if ($set['restLastSel'] and $_SESSION['uid'] > 1) { loadLastSel($calID); } <-- add the $_SESSION.... thingy here.

One step closer - at least no more ugly error messages and cookie deleting.

Posted:  16 Jan 2015 21:51
Good point Ben, thanks for this suggestion.
We will include this change in the next LuxCal versions.