X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=cards%2Fnew_card.sh;fp=cards%2Fnew_card.sh;h=edc7bc920edc9c087cb7c7c1dc8d8c9e6e22d7d0;hp=2d6c39b3ff4200f0952697e051e43a7b73e37107;hb=11e258b8e6cf832c96b20648aa8c9ca0288c597f;hpb=79c8cc42d90a62b40dd2fc2215c3d07208160f22 diff --git a/cards/new_card.sh b/cards/new_card.sh index 2d6c39b..edc7bc9 100755 --- a/cards/new_card.sh +++ b/cards/new_card.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014 Paul Hänsch +# Copyright 2014, 2019 Paul Hänsch # # This file is part of Confetti. # @@ -17,29 +17,31 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -cgi_post -cgi_refdata +filter="$(REF f)" +order="$(REF o)" -filter="&filter=${_REF[filter]}" -filtertype="&filtertype=${_REF[filtertype]}" -order="&order=${_REF[order]}" - -uid=$(uuidgenerator) +uid="$(timeid)$(randomid)" # 32 Octets UID, starting with timestamp card="${uid}.vcf" -tempfile="$_DATA/temp/$card" - -cat >"$tempfile" <"$lockfile" <<-EOF + BEGIN:VCARD + VERSION:4.0 + N:;;;; + BDAY: + TEL: + EMAIL: + ADR: + NOTE: + UID:${uid} + END:VCARD + EOF + REDIRECT "/cards/?o=${order}&f=${filter}&e=${card}" +else + SET_COOKIE session message="EDITLOCK" + REDIRECT "/cards/?o=${order}&f=${filter}" +fi