]> git.plutz.net Git - confetti/blobdiff - cards/export_card.sh
merge from cgilite
[confetti] / cards / export_card.sh
similarity index 69%
rename from actions/edit_card.sh
rename to cards/export_card.sh
index f90b326d2cca3a38dfa6b668fe3bc689c7556a9b..0918032c6019fc8da3d3be9a0711b539fdb01365 100755 (executable)
@@ -1,6 +1,6 @@
-#!/bin/zsh
+#!/bin/sh
 
 
-# Copyright 2014 Paul Hänsch
+# Copyright 2014, 2015, 2021 Paul Hänsch
 #
 # This file is part of Confetti.
 # 
 #
 # This file is part of Confetti.
 # 
 # You should have received a copy of the GNU Affero General Public License
 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
 
 # You should have received a copy of the GNU Affero General Public License
 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
 
-cgi_refdata
+card="$(GET card |PATH)"
+cardfile="$_DATA/vcard/${card##*/}"
 
 
-card="${_GET[card]}"
-filter="&filter=${_REF[filter]}"
-filtertype="&filtertype=${_REF[filtertype]}"
-order="&order=${_REF[order]}"
+. $_EXEC/pdiread.sh
+. $_EXEC/cgilite/file.sh
 
 
-echo -n "Location: ?p=cards${filter}${filtertype}${order}&edit=$card\n\n"
+printf 'Content-Disposition: inline; filename="%s.vcf"\r\n' "$(pdi_value "$(pdi_load "$cardfile")" FN)"
+
+FILE "$cardfile" "text/vcard; charset=utf-8"