From 78e756e8a4137861697bb1a1b20b6c2e7e13d7cf Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 24 Sep 2011 12:56:53 +1200 Subject: [PATCH] Add source/contact information to capabilities. --- inc/tz/capabilities.php | 23 +++++++++++++++---- .../tests/timezone/5000-capabilities.result | 7 +++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/inc/tz/capabilities.php b/inc/tz/capabilities.php index fd2610d3..7d8105f2 100644 --- a/inc/tz/capabilities.php +++ b/inc/tz/capabilities.php @@ -8,14 +8,26 @@ * @copyright Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - +$primary_source = ''; +$source = ''; +if ( substr($c->tzsource,0,4) == 'http' ) { + $source = ''.$c->tzsource.''; +} +else { + if ( empty($c->tzsource) ) $c->tzsource = '../zonedb/vtimezones'; + if ( file_exists($c->tzsource.'/primary-source') ) { + $primary_source = ''.file_get_contents($c->tzsource.'/primary-source').''; + } +} +$contact = $c->admin_email; header('Content-Type: application/xml; charset="utf-8"'); -?> + +echo << - Olson:2011m - mailto:tzs@example.org + $primary_source$source + mailto:$contact @@ -121,5 +133,6 @@ header('Content-Type: application/xml; charset="utf-8"'); Gets the capabilities of the server - - Olson:2011m + Olson tzdata2011j + mailto:tzs@example.org @@ -112,4 +113,4 @@ Content-Type: application/xml; charset="utf-8" capabilities Gets the capabilities of the server - + \ No newline at end of file