mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-30 03:24:47 +00:00
Roughing out implementation of timezone server.
This commit is contained in:
parent
bc1e264c6b
commit
731677d623
32
htdocs/tz.php
Normal file
32
htdocs/tz.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* DAViCal Timezone Service handler
|
||||||
|
*
|
||||||
|
* @package davical
|
||||||
|
* @subpackage caldav
|
||||||
|
* @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','{(capabilities|list|get|expand|update)}');
|
||||||
|
param_to_global('format','{(text/calendar|application/calendar+xml)}');
|
||||||
|
param_to_global('changesince');
|
||||||
|
param_to_global('start');
|
||||||
|
param_to_global('end');
|
||||||
|
param_to_global('lang');
|
||||||
|
$returnall = isset($_GET['returnall']);
|
||||||
|
param_to_global('tzid');
|
||||||
|
|
||||||
|
$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->DoResponse( 500, translate("The application failed to understand that request.") );
|
||||||
|
|
||||||
@ -20,6 +20,10 @@ switch ( $request->path ) {
|
|||||||
header('Location: ' . ConstructURL('/',true) );
|
header('Location: ' . ConstructURL('/',true) );
|
||||||
$request->DoResponse(301); // Moved permanently
|
$request->DoResponse(301); // Moved permanently
|
||||||
// does not return.
|
// does not return.
|
||||||
|
case '/.well-known/timezone':
|
||||||
|
header('Location: ' . ConstructURL('/tz.php',true) );
|
||||||
|
$request->DoResponse(301); // Moved permanently
|
||||||
|
// does not return.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
7
testing/tests/timezone/5000-capabilities.test
Normal file
7
testing/tests/timezone/5000-capabilities.test
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# Request timezone server capabilities
|
||||||
|
#
|
||||||
|
TYPE=GET
|
||||||
|
URL=http://regression.host/tz.php?action=capabilities
|
||||||
|
HEAD
|
||||||
|
|
||||||
7
testing/tests/timezone/5010-list.test
Normal file
7
testing/tests/timezone/5010-list.test
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# List timezone server timezones
|
||||||
|
#
|
||||||
|
TYPE=GET
|
||||||
|
URL=http://regression.host/tz.php?action=list
|
||||||
|
HEAD
|
||||||
|
|
||||||
35
testing/tests/timezone/Restore-Database.result
Normal file
35
testing/tests/timezone/Restore-Database.result
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
setval
|
||||||
|
--------
|
||||||
|
1649
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
10
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
10
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
7
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1000
|
||||||
|
(1 row)
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user