mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-22 02:04:19 +00:00
Add source/contact information to capabilities.
This commit is contained in:
parent
cd7f8c35f2
commit
78e756e8a4
@ -8,14 +8,26 @@
|
|||||||
* @copyright Morphoss Ltd
|
* @copyright Morphoss Ltd
|
||||||
* @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
$primary_source = '';
|
||||||
|
$source = '';
|
||||||
|
if ( substr($c->tzsource,0,4) == 'http' ) {
|
||||||
|
$source = '<source>'.$c->tzsource.'</source>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( empty($c->tzsource) ) $c->tzsource = '../zonedb/vtimezones';
|
||||||
|
if ( file_exists($c->tzsource.'/primary-source') ) {
|
||||||
|
$primary_source = '<primary-source>'.file_get_contents($c->tzsource.'/primary-source').'</primary-source>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$contact = $c->admin_email;
|
||||||
header('Content-Type: application/xml; charset="utf-8"');
|
header('Content-Type: application/xml; charset="utf-8"');
|
||||||
?>
|
|
||||||
|
echo <<<EOCAP
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<capabilities xmlns="urn:ietf:params:xml:ns:timezone-service">
|
<capabilities xmlns="urn:ietf:params:xml:ns:timezone-service">
|
||||||
<info>
|
<info>
|
||||||
<primary-source>Olson:2011m</primary-source>
|
$primary_source$source
|
||||||
<contact>mailto:tzs@example.org</contact>
|
<contact>mailto:$contact</contact>
|
||||||
</info>
|
</info>
|
||||||
|
|
||||||
<operation>
|
<operation>
|
||||||
@ -121,5 +133,6 @@ header('Content-Type: application/xml; charset="utf-8"');
|
|||||||
<description>Gets the capabilities of the server</description>
|
<description>Gets the capabilities of the server</description>
|
||||||
</operation>
|
</operation>
|
||||||
</capabilities>
|
</capabilities>
|
||||||
<?php
|
EOCAP;
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -1,12 +1,13 @@
|
|||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||||
Content-Length: 2986
|
Content-Length: 2992
|
||||||
Content-Type: application/xml; charset="utf-8"
|
Content-Type: application/xml; charset="utf-8"
|
||||||
|
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<capabilities xmlns="urn:ietf:params:xml:ns:timezone-service">
|
<capabilities xmlns="urn:ietf:params:xml:ns:timezone-service">
|
||||||
<info>
|
<info>
|
||||||
<primary-source>Olson:2011m</primary-source>
|
<primary-source>Olson tzdata2011j
|
||||||
|
</primary-source>
|
||||||
<contact>mailto:tzs@example.org</contact>
|
<contact>mailto:tzs@example.org</contact>
|
||||||
</info>
|
</info>
|
||||||
|
|
||||||
@ -112,4 +113,4 @@ Content-Type: application/xml; charset="utf-8"
|
|||||||
<action>capabilities</action>
|
<action>capabilities</action>
|
||||||
<description>Gets the capabilities of the server</description>
|
<description>Gets the capabilities of the server</description>
|
||||||
</operation>
|
</operation>
|
||||||
</capabilities>
|
</capabilities>
|
||||||
Loading…
x
Reference in New Issue
Block a user