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
Pages: [1]   Go Down
Print
Author Topic: search without view  (Read 365 times)
0 Members and 1 Guest are viewing this topic.
paulvallance
New Member
*

Karma: 0
Offline Offline

Posts: 0

Graphic Design/Multimedia


WWW
« on: December 04, 2003, 04:52:00 PM »

How can I allow an anonymous user to search a calendar for an event without allowing them to view the calendar. For example a company might want to let customers know if they are available on a particular date without letting the user see just how busy or quiet their business is
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: December 04, 2003, 08:22:00 PM »

** a company might want to let customers know if they are available on a particular date without letting the user see just how busy or quiet their business is **

Its pretty simple to pull up most of a calendar's events using a search. I wouldn't think limiting other's access to just the search would produce any kind of obstacle at all.

But if you want to proceed with a futile exercise, you could set up a conditional as to whether a person was logged in or not. If not, make the default 'view' for the calendar "Search". See what the query string below does on your own calendar.

cgi-bin/calendar.pl?view=Search

You'd also have to negate printing of the menu links at the side of the page but that too is easy to get around for anyone familiar with CalendarScript.

Alternately you could conditionally exclude most of the if/elsif blocks at the top of that template so that only the if ($VIEW eq "Search") clause is executed. That would make it slightly more difficult to see most of the calendar's events (but see point #1).

Dan O.


[This message has been edited by DanO (edited December 05, 2003).]

Logged
paulvallance
New Member
*

Karma: 0
Offline Offline

Posts: 0

Graphic Design/Multimedia


WWW
« Reply #2 on: December 05, 2003, 04:17:00 AM »

thanks,

have set the default view to cgi-bin/calendar.pl?view=Search but anyone can see the calendar by modifying the URL to cgi-bin/calendar.pl. Can You hide the URL when an anonymous user accesses the URL ? this would help.

regards

Paul

------------------

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: December 05, 2003, 01:37:00 PM »

** anyone can see the calendar by modifying the URL to cgi-bin/calendar.pl. **

That's what I said.

** Can You hide the URL when an anonymous user accesses the URL? **

If you displayed it in a frame but that wouldn't stop anyone that knew what they were doing.

If you used the alternate suggestion that I posted, there would no need to use the ?view=Search query string on the URL and the user modifying the URL would have no effect either.

But as I said, it's pretty simple to pull up most of a calendar's events just using the search feature so what you're proposing is no solution to security IMO.

Dan O.

------------------

Logged
paulvallance
New Member
*

Karma: 0
Offline Offline

Posts: 0

Graphic Design/Multimedia


WWW
« Reply #4 on: December 06, 2003, 04:14:00 AM »

Hi,

If I remove all the if else clauses then what happens when the administrator logs in ? The Administrator needs to see the full calendar and all the anonymous user shoud be able to do is a search to see if a particular day is free of an event. Can the Admin be set up to view a different template to the anonymous user.

Apologies for all the questions.. i don't find the documentation very helpful

thanks for your help

Paul

------------------

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: December 06, 2003, 01:23:00 PM »

** Can the Admin be set up to view a different template to the anonymous user. **

Not to my knowledge. You can however exclude/include different parts of the template code depending on different conditions like for example if the Administrator is the current user or just if the user is actually logged in or not (among a plethora of other possibilities).

** If I remove all the if else clauses **

I did say "Alternately you could conditionally exclude most of the if/elsif blocks", the key phase being conditionally.

If you changed the first if statement:

if ($VIEW eq "Month") { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); }

to:

if ($User->{username} eq "anonymous") { # meaning not logged in
$db = $main:    BEvents;
# Keep form values to populate form fields
foreach (keys %in) {$name = $_; if ($name =~ s/^FIELD_//) { $search_params->{$name} = $in{$_}; } }
$VIEW = "Search";
}
elsif ($VIEW eq "Month") { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); }

It would do the search thing for anyone not logged in.

Dan O.

------------------
BTW. the code
$main:  BEvents;
should be
$main : : D B E v e n t s ;
without any spaces between the characters.
------------------

[This message has been edited by DanO (edited December 06, 2003).]

Logged
Pages: [1]   Go Up
Print
Jump to: