* Calendar/CalDAV: allow to download whole calendar as one big iCal file using "https://$user:$passwd@domain.com/egroupware/groupdav.php/$user/calendar/?download"

This commit is contained in:
Ralf Becker 2015-11-13 15:23:36 +00:00
parent 3b781ceb05
commit ae72f4d481
2 changed files with 9 additions and 3 deletions

View File

@ -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);
}

View File

@ -33,6 +33,7 @@ require_once('HTTP/WebDAV/Server.php');
* - /<current-username>/addressbook-<other-username>/ shared addressbooks from other user or group
* - /<current-username>/addressbook-accounts/ all accounts current user has rights to see
* - /<username>/calendar/ calendar of user <username> given the user has rights to view it
* - /<username>/calendar/?download download whole calendar as .ics file (GET request!)
* - /<current-username>/calendar-<other-username>/ shared calendar from other user or group (only current <username>!)
* - /<username>/inbox/ scheduling inbox of user <username>
* - /<username>/outbox/ scheduling outbox of user <username>