relative URI syntax in Location forwards
authorpaul <paul@plutz.net>
Wed, 18 Mar 2015 16:19:07 +0000 (16:19 +0000)
committerpaul <paul@plutz.net>
Wed, 18 Mar 2015 16:19:07 +0000 (16:19 +0000)
svn path=/trunk/; revision=55

action.sh
actions/edit_attendee.sh
actions/edit_course.sh
actions/filter_attendee.sh
actions/new_attendee.sh
actions/new_course.sh
actions/update_attendee.sh
actions/update_course.sh

index 0c46d73..a0240d9 100755 (executable)
--- a/action.sh
+++ b/action.sh
@@ -19,6 +19,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\n\n"
+[ -x "$ACTION" ] || echo -n "Location: ?page=error\n\n"
 
 . $ACTION
index 66e2266..a36a3d6 100644 (file)
@@ -24,4 +24,4 @@ filter="&filter=$_REF[\"filter\"]"
 filtertype="&filtertype=$_REF[\"filtertype\"]"
 order="&order=$_REF[\"order\"]"
 
-echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
+echo -n "Location: ?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
index 2b82561..abeae20 100644 (file)
@@ -19,4 +19,4 @@
 
 course="$_GET[\"course\"]"
 
-echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n"
+echo -n "Location: ?page=courses&edit=$course\n\n"
index 392964b..a18c1eb 100755 (executable)
@@ -24,9 +24,9 @@ case "$_POST[\"choice\"]"; in
     filter="$_POST[\"filter\"]"
     filtertype="$_POST[\"filtertype\"]"
     order="$_POST[\"order\"]"
-    echo -n "Location: http://$HTTP_HOST/?page=attendees&filter=$filter&filtertype=$filtertype&order=$order\n\n"
+    echo -n "Location: ?page=attendees&filter=$filter&filtertype=$filtertype&order=$order\n\n"
     ;;
   *)
-    echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n"
+    echo -n "Location: ?page=attendees\n\n"
     ;;
 esac
index cc35038..c6d0301 100644 (file)
@@ -42,4 +42,4 @@ UID:$uid
 END:VCARD
 EOF
 
-echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
+echo -n "Location: ?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
index 1da05ce..7cd0826 100644 (file)
@@ -43,4 +43,4 @@ END:VEVENT
 END:VCARD
 EOF
 
-echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n"
+echo -n "Location: ?page=courses&edit=$course\n\n"
index 51dece8..b6c38bc 100644 (file)
@@ -54,7 +54,7 @@ case "$_POST[\"action\"]" in
   addfield)
     echo "$_POST[\"newfield\"]:\r" >>"$tempfile"
     echo "END:VCARD\r" >>"$tempfile"
-    echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
+    echo -n "Location: ?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
     ;;
   update)
     attendance=()
@@ -74,16 +74,16 @@ case "$_POST[\"action\"]" in
 
     echo "END:VCARD\r" >>"$tempfile"
     mv "$tempfile" "$cardfile"
-    echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}#$card\n\n"
+    echo -n "Location: ?page=attendees${filter}${filtertype}${order}#$card\n\n"
     ;;
   cancel)
     rm "$tempfile"
     [ -f "$cardfile" ] \
-      && echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}#$card\n\n" \
-      || echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n"
+      && echo -n "Location: ?page=attendees${filter}${filtertype}${order}#$card\n\n" \
+      || echo -n "Location: ?page=attendees${filter}${filtertype}${order}\n\n"
     ;;
   delete)
     rm "$tempfile" "$cardfile"
-    echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n"
+    echo -n "Location: ?page=attendees${filter}${filtertype}${order}\n\n"
     ;;
 esac
index 4e75e64..0e1ee24 100644 (file)
@@ -88,27 +88,27 @@ case "$_POST[\"action\"]" in
     echo "$_POST[\"newfield\"]:\r" >>"$tempfile"
     echo "END:VEVENT\r" >>"$tempfile"
     echo "END:VCALENDAR\r" >>"$tempfile"
-    echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n"
+    echo -n "Location: ?page=courses&edit=$course\n\n"
     ;;
   update)
     echo "END:VEVENT\r" >>"$tempfile"
     echo "END:VCALENDAR\r" >>"$tempfile"
     mv "$tempfile" "$coursefile"
-    echo -n "Location: http://$HTTP_HOST/?page=courses#$course\n\n"
+    echo -n "Location: ?page=courses#$course\n\n"
     ;;
   cancel)
     rm "$tempfile"
     [ -f "$coursefile" ] \
-      && echo -n "Location: http://$HTTP_HOST/?page=courses#$course\n\n" \
-      || echo -n "Location: http://$HTTP_HOST/?page=courses\n\n"
+      && echo -n "Location: ?page=courses#$course\n\n" \
+      || echo -n "Location: ?page=courses\n\n"
     ;;
   delete)
     rm "$tempfile" "$coursefile"
-    echo -n "Location: http://$HTTP_HOST/?page=courses\n\n"
+    echo -n "Location: ?page=courses\n\n"
     ;;
   *)
     echo "END:VEVENT\r" >>"$tempfile"
     echo "END:VCALENDAR\r" >>"$tempfile"
-    echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n"
+    echo -n "Location: ?page=courses&edit=$course\n\n"
     ;;
 esac