From ae72f4d48137813378c4e8ae3b3bce2b52239c55 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 13 Nov 2015 15:23:36 +0000 Subject: [PATCH] * Calendar/CalDAV: allow to download whole calendar as one big iCal file using "https://$user:$passwd@domain.com/egroupware/groupdav.php/$user/calendar/?download" --- calendar/inc/class.calendar_groupdav.inc.php | 11 ++++++++--- phpgwapi/inc/class.groupdav.inc.php | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index ca91a79e1a..7049ac8b72 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -150,7 +150,7 @@ class calendar_groupdav extends groupdav_handler return $this->free_busy_report($path, $options, $user); } - if (isset($_GET['checkout'])) + if (isset($_GET['download'])) { $this->groupdav->propfind_options['props'] = array(array( 'xmlns' => groupdav::CALDAV, @@ -253,7 +253,7 @@ class calendar_groupdav extends groupdav_handler // return iterator, calling ourself to return result in chunks $files['files'] = new groupdav_propfind_iterator($this,$path,$filter,$files['files']); } - if (isset($_GET['checkout'])) + if (isset($_GET['download'])) { $this->output_vcalendar($files['files']); } @@ -281,9 +281,14 @@ class calendar_groupdav extends groupdav_handler { if ($n === 2) { + // skip X-CALENDARSERVER-ACCESS:CONFIDENTIAL, as it is on VCALENDAR not VEVENT level + if (($x_calendarserver_access = strpos($icalendar, 'X-CALENDARSERVER-ACCESS:')) !== false) + { + echo substr($icalendar, 0, $x_calendarserver_access); + } // skip timezones, as we would need to collect them from all events // ans most clients understand timezone by reference anyway - if (($tz = strpos($icalendar, 'BEGIN:VTIMEZONE')) !== false) + elseif (($tz = strpos($icalendar, 'BEGIN:VTIMEZONE')) !== false) { echo substr($icalendar, 0, $tz); } diff --git a/phpgwapi/inc/class.groupdav.inc.php b/phpgwapi/inc/class.groupdav.inc.php index 1706d550a0..9d0195431d 100644 --- a/phpgwapi/inc/class.groupdav.inc.php +++ b/phpgwapi/inc/class.groupdav.inc.php @@ -33,6 +33,7 @@ require_once('HTTP/WebDAV/Server.php'); * - //addressbook-/ shared addressbooks from other user or group * - //addressbook-accounts/ all accounts current user has rights to see * - //calendar/ calendar of user given the user has rights to view it + * - //calendar/?download download whole calendar as .ics file (GET request!) * - //calendar-/ shared calendar from other user or group (only current !) * - //inbox/ scheduling inbox of user * - //outbox/ scheduling outbox of user