From daf4b56b27a3eae9513b6716aaa3e98e93a728a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 20 Aug 2019 13:57:51 +0200 Subject: [PATCH] vcard exporter --- cards/export_card.sh | 11 ++++++++--- cards/list.sh | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cards/export_card.sh b/cards/export_card.sh index d6ea293..e9356a9 100755 --- a/cards/export_card.sh +++ b/cards/export_card.sh @@ -17,6 +17,11 @@ # 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##*/}" + +if [ -f "$cardfile" ]; then + . $_EXEC/cgilite/file.sh + FILE "$cardfile" "text/vcard/charset=utf-8" +else +fi diff --git a/cards/list.sh b/cards/list.sh index 6c0f18b..f2f4a4b 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -95,7 +95,7 @@ print_card(){ ] [div .control [a .item href="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)] - [a .item href="/cards/?x=${cardfile##*/}" $(l10n vcf_export)] + [a .item href="/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)] ] ] EOF -- 2.39.2