3 * CalDAV Server - handle OPTIONS method
7 * @author Andrew McMillan <andrew@mcmillan.net.nz>
8 * @copyright Catalyst .Net Ltd, Morphoss Ltd <http://www.morphoss.com/>
9 * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
11 dbg_error_log("OPTIONS", "method handler");
13 include_once('DAVResource.php');
14 $resource = new DAVResource($request->path
);
17 * The spec calls for this to be controlled by 'read' access, but we expand
18 * that a little to also allow read-current-user-privilege-set since we grant that
19 * more generally and Mozilla attempts this and gets upset...
21 $resource->NeedPrivilege( array('DAV::read','DAV::read-current-user-privilege-set'), true );
23 if ( !$resource->Exists() ) {
24 $request->DoResponse( 404, translate("No collection found at that location.") );
27 $allowed = implode( ', ', array_keys($resource->FetchSupportedMethods()) );
28 header( 'Allow: '.$allowed);
30 $request->DoResponse( 200, "" );