X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=actions%2Fupdate_attendee.sh;h=6bfbe8822315d4f666a4850dd8fd2abde2491e1c;hp=10eb82c419b7716856c7c121b9d7ba7a4998cdb1;hb=3badbe5f34b9a481f43f83d07d4cd28a3aa7798b;hpb=9da739230659371a860e93dcaf3765b977e30de7 diff --git a/actions/update_attendee.sh b/actions/update_attendee.sh index 10eb82c..6bfbe88 100644 --- a/actions/update_attendee.sh +++ b/actions/update_attendee.sh @@ -8,6 +8,8 @@ cardfile="vcard/$card" echo "BEGIN:VCARD\r" >"$tempfile" echo "VERSION:4.0\r" >>"$tempfile" +echo "N:$_POST[\"0N\"];$_POST[\"1N\"];$_POST[\"2N\"];$_POST[\"3N\"];$_POST[\"4N\"]\r" >>"$tempfile" +echo "UID:$_POST[\"UID\"]\r" >>"$tempfile" for field in $VCF_FIELDS; do value="$_POST[\"$field\"]" n=0 @@ -22,7 +24,7 @@ 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&edit=$card\n\n" ;; update) echo "END:VCARD\r" >>"$tempfile" @@ -31,6 +33,12 @@ case "$_POST[\"action\"]" in ;; cancel) rm "$tempfile" - echo -n "Location: http://$HTTP_HOST/?page=attendees#$card\n\n" + [ -f "$cardfile" ] \ + && echo -n "Location: http://$HTTP_HOST/?page=attendees#$card\n\n" \ + || echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n" + ;; + delete) + rm "$tempfile" "$cardfile" + echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n" ;; esac