X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=cards%2Fexport_card.sh;h=0918032c6019fc8da3d3be9a0711b539fdb01365;hp=d6ea2937304bb0ffeae647358546a309db429d56;hb=f0f4a2847ec2fe8226682eee26c902a3b6d64f58;hpb=1b5fe5ec8e6ceb580ada4e0ff4fe3955c2457ec0 diff --git a/cards/export_card.sh b/cards/export_card.sh index d6ea293..0918032 100755 --- a/cards/export_card.sh +++ b/cards/export_card.sh @@ -1,6 +1,6 @@ -#!/bin/zsh +#!/bin/sh -# Copyright 2014,2015 Paul Hänsch +# Copyright 2014, 2015, 2021 Paul Hänsch # # This file is part of Confetti. # @@ -17,6 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -echo -n "Content-Type: text/vcard;charset=utf-8\n\n" -card="${_GET[card]}" -cat "$_DATA/vcard/$card" +card="$(GET card |PATH)" +cardfile="$_DATA/vcard/${card##*/}" + +. $_EXEC/pdiread.sh +. $_EXEC/cgilite/file.sh + +printf 'Content-Disposition: inline; filename="%s.vcf"\r\n' "$(pdi_value "$(pdi_load "$cardfile")" FN)" + +FILE "$cardfile" "text/vcard; charset=utf-8"