Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)pass login information to event_detail_popup template from Metacalendar
Pages: [1]   Go Down
Print
Author Topic: pass login information to event_detail_popup template from Metacalendar  (Read 1129 times)
0 Members and 1 Guest are viewing this topic.
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« on: August 28, 2008, 03:28:42 PM »

Hello,

Does anyone know how to pass login information to the event_detail_popup.html template from the Metacalendar?  I would like the template to display certain information to certain users, and hide from others.  The template seems to think it is being viewed by "anonymous", (<%=$User->{username}%>) whether someone is logged in or not. So the conditional code I am adding to the template is not working.  Thank you.
« Last Edit: August 28, 2008, 04:01:52 PM by wderzawiec » Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: August 28, 2008, 04:50:09 PM »

.
** how to pass login information to the event_detail_popup.html template **

Add them to the link URL(s) in the standard &Variable_Name=Value format.


** The template seems to think it is being viewed by "anonymous" **

I don't know why that would be if the user was logged in. The cookie that stores the user data should still be set. What you're saying would prevent any non-public events from being seen from the Meta Calendar whether the user was entitled or not.

JMO

Dan O.

« Last Edit: August 28, 2008, 04:57:30 PM by DanO » Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #2 on: August 28, 2008, 10:20:00 PM »

Quote
Add them to the link URL(s) in the standard &Variable_Name=Value format.

Mm, tried that, it didn't work.  With &username=<%=$User->{username}%> in the link, the username I am logged in as shows up in the URL at the top of the popup window pane, but still the <%=$User->{username}%> code in the popup template itself shows up as "anonymous".  If I configure the target calender to require login, the login screen shows up in the popup, even if I am logged in as Administrator (or anything else).

It's very odd.  And, I could have sworn it was working last week. The only thing I did to change things was add a couple of calendars to the metacalendar, and imported the data for them using FTP (I had them using another copy of calendarscript elsewhere on the server).  But I've deleted those calendars and it's behaving the same way.
« Last Edit: August 29, 2008, 04:04:15 PM by wderzawiec » Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: August 29, 2008, 08:40:57 PM »

.
Quote
still the <%=$User->{username}%> code in the popup template itself shows up as "anonymous".

To display the passed values you would have to access them using the variable name you used to pass it (which isn't $User->{username}). YOU can not set the value for $User->{username} yourself, it is populated by the script from cookie information.

JFYI

Dan O.
Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #4 on: August 29, 2008, 10:10:07 PM »

I'm not making myself clear.  I want to have the event_detail_popup.html template display or not display certain information based on which user is logged in.  Because the conditionals I was putting in the template weren't working, I wondered if the login information was being passed to the template. I put the <%$User->{name}%> in the template to see what user information the template was getting.  Apparently the cookie wasn't doing its job.
Anyway I think I've solved the problem - there were three lines in the display_after_getInput.pl file in the MetaCalendar package that were commented out:
         $Session->setValue('calendar', $from_cal);
    $Session->saveSession();
    $Session->{'calendar'} = $from_cal;

  I uncommented them and that seems to be working.  Can't figure out why it was working last week though without them.  Thank you as always.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: August 30, 2008, 01:49:21 AM »

** I uncommented them and that seems to be working. **

Glad to hear you found a fix.

** Can't figure out why it was working last week though without them. **

Me neither. AFAIK those values should be set by the script provided the user is logged in.

Dan O.
Logged
Pages: [1]   Go Up
Print
Jump to: