From b470561d3d40f4989eb8ed17eca5912f63c247e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 5 Feb 2021 02:42:45 +0100 Subject: [PATCH] ical export using cgilite --- courses/export_ical.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/courses/export_ical.sh b/courses/export_ical.sh index e595cb6..3649ed5 100755 --- a/courses/export_ical.sh +++ b/courses/export_ical.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014,2015 Paul Hänsch +# Copyright 2014,2015,2021 Paul Hänsch # # This file is part of Confetti. # @@ -17,6 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -echo -n "Content-Type: text/calendar;charset=utf-8\n\n" -course="${_GET[course]}" -cat "$_DATA/ical/$course" +course="$(GET course |PATH)" +coursefile="$_DATA/ical/${course##*/}" + +. $_EXEC/pdiread.sh +. $_EXEC/cgilite/file.sh + +printf 'Content-Disposition: inline; filename="%s.ics"\r\n' "$(pdi_value "$(pdi_load "$coursefile")" SUMMARY)" + +FILE "$coursefile" "text/calendar; charset=utf-8" -- 2.39.2