Basic 'capabilities' response for timezone protocol.

This commit is contained in:
Andrew McMillan committed 2011-09-17 17:59:36 +12:00
1 parent 93b790cd52
commit b160ead5a0
2 files changed
+130 -4

No files matched your search

+5 -4
View File
@@ -3,7 +3,7 @@
* DAViCal Timezone Service handler
*
* @package davical
* @subpackage caldav
* @subpackage tzservice
* @author Andrew McMillan <andrew@morphoss.com>
* @copyright Morphoss Ltd
* @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -12,8 +12,8 @@ require("./always.php");
require("PublicSession.php");
$session = new PublicSession();
param_to_global('action','{(capabilities|list|get|expand|update)}');
param_to_global('format','{(text/calendar|application/calendar+xml)}');
param_to_global('action','{[a-z_-]+}');
param_to_global('format','{[a-z]+/[a-zA-Z0-9.+_-]+}');
param_to_global('changesince');
param_to_global('start');
param_to_global('end');
@@ -21,11 +21,12 @@ param_to_global('lang');
$returnall = isset($_GET['returnall']);
param_to_global('tzid');
require_once('CalDAVRequest.php');
$request = new CalDAVRequest();
$code_file = sprintf( 'tz/%s.php', $action );
if ( ! @include_once( $code_file ) ) {
$request->PreconditionFailed(400, "supported-action", 'The action "'+$_GET['action']+'" is not understood.' );
$request->PreconditionFailed(400, "supported-action", 'The action "'.$_GET['action'].'" is not understood.' );
}
$request->DoResponse( 500, translate("The application failed to understand that request.") );