X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=actions%2Fupdate_attendee.sh;h=9657d0577b4bd57728bbd757a5b0719a9d0585e7;hp=ba84be8f75462627580b3f45643137269217cfb1;hb=debd0bd0d774c6151a8fbf6759778e2e0757c8bd;hpb=be5f12e43f464b3ca924b2131fe74d6cf24981a1 diff --git a/actions/update_attendee.sh b/actions/update_attendee.sh index ba84be8..9657d05 100644 --- a/actions/update_attendee.sh +++ b/actions/update_attendee.sh @@ -1,6 +1,11 @@ #!/bin/zsh cgi_post +cgi_refdata + +filter="&filter=$_REF[\"filter\"]" +filtertype="&filtertype=$_REF[\"filtertype\"]" +order="&order=$_REF[\"order\"]" card="$_POST[\"card\"]" tempfile="temp/$card" @@ -24,15 +29,21 @@ case "$_POST[\"action\"]" in addfield) echo "$_POST[\"newfield\"]:\r" >>"$tempfile" echo "END:VCARD\r" >>"$tempfile" - echo -n "Location: http://$HTTP_HOST/?page=attendees&edit=$card#$card\n\n" + echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n" ;; update) echo "END:VCARD\r" >>"$tempfile" mv "$tempfile" "$cardfile" - echo -n "Location: http://$HTTP_HOST/?page=attendees#$card\n\n" + echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}#$card\n\n" ;; cancel) rm "$tempfile" - echo -n "Location: http://$HTTP_HOST/?page=attendees#$card\n\n" + [ -f "$cardfile" ] \ + && echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}#$card\n\n" \ + || echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n" + ;; + delete) + rm "$tempfile" "$cardfile" + echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n" ;; esac