3 dbg_error_log( 'well-known', 'iSchedule requested' );
5 require_once('HTTPAuthSession.php');
6 $c->allow_unauthenticated
= true;
7 $session = new HTTPAuthSession();
9 if ( ! isset ( $request ) ) {
10 require_once('CalDAVRequest.php');
11 $request = new CalDAVRequest();
15 switch ( $request->path
) {
16 case '/.well-known/caldav':
17 case '/.well-known/carddav':
18 header('Location: ' . $c->protocol_server_port
. ConstructURL('/',true) );
19 $request->DoResponse(301); // Moved permanently
21 case '/.well-known/timezone':
23 foreach( $_GET as $k => $v ) {
24 $parameters .= ($parameters == '' ?
'?' : '&' );
25 $parameters .= $k.'='.rawurlencode($v);
27 header('Location: ' . $c->protocol_server_port
. str_replace('/caldav.php', '', ConstructURL('/tz.php',true)).$parameters );
28 $request->DoResponse(301); // Moved permanently
34 if ( $c->enable_scheduling
!= true )
36 $request->DoResponse( 404, translate('The application program does not understand that request.') );
39 dbg_log_array( 'well-known', 'method:'. $request->method
);
40 switch ( $request->method
) {
41 case 'GET': ischedule_get(); break;
42 case 'POST': include('iSchedule-POST.php'); break;
45 dbg_error_log( 'well-known', 'Unhandled request method >>%s<<', $request->method
);
46 dbg_log_array( 'well-known', '_SERVER', $_SERVER, true );
47 dbg_error_log( 'well-known', 'RAW: %s', str_replace("\n", '',str_replace("\r", '', $request->raw_post
)) );
50 $request->DoResponse( 500, translate('The application program does not understand that request.') );
56 function ischedule_get ( )
59 if ( $request->path
!= '/.well-known/ischedule' ||
$_GET['query'] != 'capabilities' )
61 $request->DoResponse( 404, translate('The application program does not understand that request.' . $request->path
) );
64 header ( 'iSchedule-Version: 1.0' );
65 header ( 'Content-Type: application/xml; charset=utf-8' );
66 echo '<?xml version="1.0" encoding="utf-8" ?>';
68 <query-result xmlns="urn:ietf:params:xml:ns:ischedule">
70 <supported-version-set>
71 <version>1.0</version>
72 </supported-version-set>
73 <supported-scheduling-message-set>
75 <method name="REQUEST"/>
77 <method name="REPLY"/>
78 <method name="CANCEL"/>
81 <comp name="VFREEBUSY"/>
82 </supported-scheduling-message-set>
83 <supported-calendar-data-type>
84 <calendar-data-type content-type="text/calendar" version="2.0"/>
85 </supported-calendar-data-type>
86 <supported-attachment-values>
88 </supported-attachment-values>
89 <supported-recipient-uri-scheme-set>
90 <scheme>mailto</scheme>
91 </supported-recipient-uri-scheme-set>
92 <max-content-length>102400</max-content-length>
93 <min-date-time>19910101T000000Z</min-date-time>
94 <max-date-time>20381231T000000Z</max-date-time>
95 <max-instances>150</max-instances>
96 <max-recipients>250</max-recipients>
99 // <external-attachment/> // TODO: figure out if we actually support this
100 echo ' <administrator>mailto:' . $c->admin_email
. '</administrator>' . "\n";
106 @ob_flush
(); exit(0);