allow_unauthenticated = true; $session = new HTTPAuthSession(); if ( ! isset ( $request ) ) { require_once('CalDAVRequest.php'); $request = new CalDAVRequest(); } dbg_log_array( 'well-known', 'SESSAO', $session, true ); switch ( $request->path ) { case '/.well-known/caldav': case '/.well-known/carddav': header('Location: ' . ConstructURL('/'.$session->username.'/addressbook/',true) ); exit(0); } if ( $c->enable_scheduling != true ) { $request->DoResponse( 404, translate('The application program does not understand that request.') ); exit (); } header ( 'iSchedule-Version: 1.0' ); switch ( $request->method ) { case 'GET': ischedule_get(); break; case 'POST': include('iSchedule.php'); break; default: dbg_error_log( 'well-known', 'Unhandled request method >>%s<<', $request->method ); dbg_log_array( 'well-known', '_SERVER', $_SERVER, true ); dbg_error_log( 'well-known', 'RAW: %s', str_replace("\n", '',str_replace("\r", '', $request->raw_post)) ); } $request->DoResponse( 500, translate('The application program does not understand that request.') ); function ischedule_get ( ) { global $request,$c; if ( $request->path != '/.well-known/ischedule' || $_GET['query'] != 'capabilities' ) { $request->DoResponse( 404, translate('The application program does not understand that request.' . $request->path ) ); return false; } header ( 'Content-Type: application/xml; charset=utf-8' ); echo ''; echo << 1.0 mailto 102400 19910101T000000Z 20381231T000000Z 150 250 RESPONSE; echo ' mailto:' . $c->admin_email . '' . "\n"; echo << RESPONSE; exit ( 0 ); }