X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=actions%2Fupdate_course.sh;h=d95d06250fb19ed71408a1b993a7c5a94b8022ff;hp=ebe481a471a883ada52b17ab23dd820ac561ab7d;hb=16deeb30487a64daff6475da5a008a061f581f92;hpb=c195881a2389862d4bfcd2fd55ca868f7a20b8e8 diff --git a/actions/update_course.sh b/actions/update_course.sh index ebe481a..d95d062 100644 --- a/actions/update_course.sh +++ b/actions/update_course.sh @@ -1,5 +1,22 @@ #!/bin/zsh +# Copyright 2014 Paul Hänsch +# +# This file is part of Confetti. +# +# Confetti is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Confetti is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Confetti. If not, see . + cgi_post course="$_POST[\"course\"]" @@ -71,27 +88,27 @@ case "$_POST[\"action\"]" in echo "$_POST[\"newfield\"]:\r" >>"$tempfile" echo "END:VEVENT\r" >>"$tempfile" echo "END:VCALENDAR\r" >>"$tempfile" - echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n" + echo -n "Location: ?p=courses&edit=$course\n\n" ;; update) echo "END:VEVENT\r" >>"$tempfile" echo "END:VCALENDAR\r" >>"$tempfile" mv "$tempfile" "$coursefile" - echo -n "Location: http://$HTTP_HOST/?page=courses#$course\n\n" + echo -n "Location: ?p=courses#$course\n\n" ;; cancel) rm "$tempfile" [ -f "$coursefile" ] \ - && echo -n "Location: http://$HTTP_HOST/?page=courses#$course\n\n" \ - || echo -n "Location: http://$HTTP_HOST/?page=courses\n\n" + && echo -n "Location: ?p=courses#$course\n\n" \ + || echo -n "Location: ?p=courses\n\n" ;; delete) rm "$tempfile" "$coursefile" - echo -n "Location: http://$HTTP_HOST/?page=courses\n\n" + echo -n "Location: ?p=courses\n\n" ;; *) echo "END:VEVENT\r" >>"$tempfile" echo "END:VCALENDAR\r" >>"$tempfile" - echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n" + echo -n "Location: ?p=courses&edit=$course\n\n" ;; esac