Block invalid tickets from having access.

Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
Andrew McMillan 2011-01-15 16:42:59 +13:00
parent ed7ffea332
commit 8f25a8a393

View File

@ -20,11 +20,14 @@ header( "DAV: $dav");
require_once("CalDAVRequest.php");
$request = new CalDAVRequest();
if ( !isset($request->ticket) && !$request->IsPublic()
|| (isset($request->ticket) && $request->ticket->expired ) ) {
if ( ! $request->IsPublic()
|| ! isset($request->ticket)
|| $request->ticket->expired
|| ! $request->ticket->MatchesPath($request->path) ) {
$request->DoResponse( 403, translate('Anonymous users may only access public calendars') );
}
switch ( $request->method ) {
case 'OPTIONS': include_once("caldav-OPTIONS.php"); break;
case 'REPORT': include_once("caldav-REPORT.php"); break;