]> git.plutz.net Git - confetti/commitdiff
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 f8fef05571912b0540d5bdf9049bc87c8d07f64b..d9d6be2bbebef7f6eb41e6679fc1a6eaf239d9a6 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 277f7ae0517f4c7eeb01edc08c67fb4fbb236ba3..92310fd95cb10b877f25fe2b4a5a56e7588f7449 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 3d7ad0457eff8d21e795d3fea609906ffc6acb3b..fe33c18e33ee2d26f414600a24bf9021f4880e2a 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