2011-09-02 14:55:56 +04:00
|
|
|
<?php
|
2011-09-24 00:59:24 +04:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2011-09-02 14:55:56 +04:00
|
|
|
require_once ("../../lib/base.php");
|
2011-09-18 23:31:56 +04:00
|
|
|
OC_Util::checkLoggedIn();
|
2011-09-02 14:55:56 +04:00
|
|
|
$cal = $_GET["calid"];
|
|
|
|
$calendar = OC_Calendar_Calendar::findCalendar($cal);
|
|
|
|
if($calendar["userid"] != OC_User::getUser()){
|
2011-09-18 23:31:56 +04:00
|
|
|
header( 'Location: '.OC_Helper::linkTo('', 'index.php'));
|
2011-09-02 14:55:56 +04:00
|
|
|
exit;
|
|
|
|
}
|
2011-09-15 12:14:47 +04:00
|
|
|
$calobjects = OC_Calendar_Object::all($cal);
|
2011-09-02 14:55:56 +04:00
|
|
|
header("Content-Type: text/Calendar");
|
|
|
|
header("Content-Disposition: inline; filename=calendar.ics");
|
|
|
|
for($i = 0;$i <= count($calobjects); $i++){
|
|
|
|
echo $calobjects[$i]["calendardata"] . "\n";
|
|
|
|
}
|
2011-09-15 12:14:47 +04:00
|
|
|
?>
|