File: tz.php

package info (click to toggle)
davical 1.1.12-2.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,020 kB
  • sloc: php: 19,361; sql: 4,514; perl: 3,524; sh: 554; javascript: 162; makefile: 85
file content (33 lines) | stat: -rw-r--r-- 1,017 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* DAViCal Timezone Service handler
*
* @package   davical
* @subpackage   tzservice
* @author    Andrew McMillan <andrew@morphoss.com>
* @copyright Morphoss Ltd
* @license   http://gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require("./always.php");
require("PublicSession.php");
$session = new PublicSession();

param_to_global('action','{[a-z_-]+}');
param_to_global('format','{[a-z]+/[a-zA-Z0-9.+_-]+}');
param_to_global('changedsince','{.*}','changesince');
param_to_global('start');
param_to_global('end');
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 "'.$action.'" is not understood.', 'urn:ietf:params:xml:ns:timezone-service' );
}

$request->DoResponse( 500, translate("The application failed to understand that request.") );