Reads to /public.php/... will work if the collection is publicly_readable.

This commit is contained in:
Andrew McMillan committed 2009-04-17 01:04:43 +12:00
1 parent f65770b7f1
commit 06549086a1
2 files changed
+82 -5

No files matched your search

+6 -5
View File
@@ -8,13 +8,11 @@
* @copyright Catalyst .Net Ltd
* @license http://gnu.org/copyleft/gpl.html GNU GPL v2
*/
require_once("../inc/always.php");
require("../inc/always.php");
dbg_error_log( "caldav", " User agent: %s", ((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "Unfortunately Mulberry does not send a 'User-agent' header with its requests :-(")) );
dbg_log_array( "headers", '_SERVER', $_SERVER, true );
$session = (object) array(
'username' => 'public',
'user_no' => -1
);
require("PublicSession.php");
$session = new PublicSession();
/** A simplified DAV header in this case */
$dav = "1, 2, calendar-access";
@@ -22,6 +20,9 @@ header( "DAV: $dav");
require_once("CalDAVRequest.php");
$request = new CalDAVRequest();
if ( !$request->IsPublic() ) {
$request->DoResponse( 403, translate('Anonymous users may only access public calendars') );
}
switch ( $request->method ) {
case 'OPTIONS': include_once("caldav-OPTIONS.php"); break;