summaryrefslogtreecommitdiffstats
path: root/apps/calendar/share.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-03-31 17:32:43 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-03-31 17:32:43 +0100
commitcf26f8a6a7751bd32eeb449ef39b743248ae3d1a (patch)
tree46fb03a584a8462596c560f203413fee75a74f62 /apps/calendar/share.php
parent4b3f074309fe9075119a56c337d7e8ad30d2c73a (diff)
downloadnextcloud-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.php22
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