diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-04-21 23:21:50 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-04-21 23:21:50 +0200 |
commit | 0918fc7d9156f3846a19b673db5b01422a59c506 (patch) | |
tree | 131188252fd42c4f3c9673975adafa24783c632f /apps/calendar/share.php | |
parent | 77cefdedb86de65e69f470c8b6a1b03bb001966e (diff) | |
parent | 74e540271122222f650bbbfaeaac310b0e592674 (diff) | |
download | nextcloud-server-0918fc7d9156f3846a19b673db5b01422a59c506.tar.gz nextcloud-server-0918fc7d9156f3846a19b673db5b01422a59c506.zip |
fix merge conflicts
Diffstat (limited to 'apps/calendar/share.php')
-rw-r--r-- | apps/calendar/share.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/calendar/share.php b/apps/calendar/share.php new file mode 100644 index 00000000000..1cc8a2ef15e --- /dev/null +++ b/apps/calendar/share.php @@ -0,0 +1,23 @@ +<?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($shared['id'], false); + $calobjects = OC_Calendar_Object::all($shared['id']); + 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']; +}else{ + header('Error 404: Not Found'); +}
\ No newline at end of file |