From: paul Date: Thu, 21 Nov 2013 15:42:38 +0000 (+0000) Subject: stubs for action mechanics X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=9917259ba7ae33000a3aeb892f392ed71ad0377d;p=lobster stubs for action mechanics svn path=/trunk/; revision=18 --- diff --git a/action.sh b/action.sh index f8fef05..d9d6be2 100755 --- a/action.sh +++ b/action.sh @@ -2,6 +2,6 @@ ACTION="$(echo "$_GET[\"action\"]" |egrep '^[a-zA-Z0-9_-]+$')" ACTION="${_EXEC}/actions/${ACTION}.sh" -[ -x "$ACTION" ] || echo -n "Location: http://$HTTP_HOST/?page=error" +[ -x "$ACTION" ] || echo -n "Location: http://$HTTP_HOST/?page=error\n\n" . $ACTION diff --git a/actions/update_attendee.sh b/actions/update_attendee.sh new file mode 100644 index 0000000..3c6ad55 --- /dev/null +++ b/actions/update_attendee.sh @@ -0,0 +1,7 @@ +#!/bin/zsh + +cgi_post + +debug $_POST + +echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n" diff --git a/index.cgi b/index.cgi index 277f7ae..92310fd 100755 --- a/index.cgi +++ b/index.cgi @@ -30,7 +30,7 @@ debug "Storage dir: $_DATA" [ -w "$_DATA" ] && [ -d "$_DATA" ] || die "storage directory must be writable" # create directories for object storage -for each in "$_DATA"/{vcard,mappings,courses,cache}; do +for each in "$_DATA"/{vcard,mappings,courses,cache,temp}; do [ ! -e "$each" ] && mkdir "$each" [ -w "$each" ] && [ -d "$each" ] || die "storage $each must be a writable directory" done diff --git a/templates/edit_attendee.sh b/templates/edit_attendee.sh index 3d7ad04..fe33c18 100755 --- a/templates/edit_attendee.sh +++ b/templates/edit_attendee.sh @@ -18,6 +18,8 @@ edit_card_item() { edit_attendee() { cardfile="$1" + tempfile="temp/$_GET[\"edit\"].vcf" + [ -x "$tempfile" ] && cardfile="$tempfile" unset key vcf_parse "$cardfile" |while read -r line; do declare -A tag