diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-03-31 17:32:43 +0100 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-03-31 17:32:43 +0100 |
commit | cf26f8a6a7751bd32eeb449ef39b743248ae3d1a (patch) | |
tree | 46fb03a584a8462596c560f203413fee75a74f62 /apps/calendar/share.php | |
parent | 4b3f074309fe9075119a56c337d7e8ad30d2c73a (diff) | |
download | nextcloud-server-cf26f8a6a7751bd32eeb449ef39b743248ae3d1a.tar.gz nextcloud-server-cf26f8a6a7751bd32eeb449ef39b743248ae3d1a.zip |
add public sharing for calendars and events
Diffstat (limited to 'apps/calendar/share.php')
-rw-r--r-- | apps/calendar/share.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/calendar/share.php b/apps/calendar/share.php index 8d1c8b69c3f..3e45fdeee15 100644 --- a/apps/calendar/share.php +++ b/apps/calendar/share.php @@ -1 +1,21 @@ - +<?php +require_once('../../lib/base.php'); +$token = strip_tags($_GET['t']); +$shared = OC_Calendar_Share::getElementByToken($token); +$nl = "\n\r"; +if($shared['type'] == OC_Calendar_Share::CALENDAR){ + $calendar = OC_Calendar_App::getCalendar($cal, false); + $calobjects = OC_Calendar_Object::all($cal); + header('Content-Type: text/Calendar'); + header('Content-Disposition: inline; filename=' . $calendar['displayname'] . '.ics'); + foreach($calobjects as $calobject){ + echo $calobject['calendardata'] . $nl; + } +}elseif($shared['type'] == OC_Calendar_Share::EVENT){ + $data = OC_Calendar_App::getEventObject($shared['id'], false); + $calendarid = $data['calendarid']; + $calendar = OC_Calendar_App::getCalendar($calendarid); + header('Content-Type: text/Calendar'); + header('Content-Disposition: inline; filename=' . $data['summary'] . '.ics'); + echo $data['calendardata']; +}
\ No newline at end of file |