getConfig('disable_ics') === 1) { die("ICS synchronisation is disabled"); } // Retrieve calendar ID based on private URI $calid = $hlp->getCalendarForPrivateURL($icsFile); if($calid === false) die("No calendar with this name known."); // Retrieve calendar contents and serve $stream = $hlp->getCalendarAsICSFeed($calid); header("Content-Type: text/calendar"); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename=\"calendar.ics\""); echo $stream;