stubs for action mechanics
authorpaul <paul@plutz.net>
Thu, 21 Nov 2013 15:42:38 +0000 (15:42 +0000)
committerpaul <paul@plutz.net>
Thu, 21 Nov 2013 15:42:38 +0000 (15:42 +0000)
svn path=/trunk/; revision=18

action.sh
actions/update_attendee.sh [new file with mode: 0644]
index.cgi
templates/edit_attendee.sh

index f8fef05..d9d6be2 100755 (executable)
--- 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 (file)
index 0000000..3c6ad55
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/zsh
+
+cgi_post
+
+debug $_POST
+
+echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n"
index 277f7ae..92310fd 100755 (executable)
--- 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
index 3d7ad04..fe33c18 100755 (executable)
@@ -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