X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=actions%2Fupdate_attendee.sh;h=9657d0577b4bd57728bbd757a5b0719a9d0585e7;hp=fee91fc3d0f405a652e4a2315f46953ccb58c7d1;hb=25a24a7d834757e006b46b863453d5f79780a63f;hpb=19a85441a8f173c3d2cd3d29fd7d95d2b471bb3c diff --git a/actions/update_attendee.sh b/actions/update_attendee.sh index fee91fc..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,19 +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\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\n\n" + echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n" ;; esac