# serialize POST array into file
for key in $(POST_KEYS); do
- [ "$key" != imagedata ] && printf %s:%s\\n "$key" "$(POST "$key" |sed ':X;N;$!bX; s;\n;\\n;g;')"
+ case "$key" in
+ imagedata) true ;;
+ session*_date)
+ value="$(POST "$key" |sed ':X;N;$!bX; s;\n;\\n;g;')"
+ y=0 mon=0 dom=0
+ case $value in
+ *.*.*) IFS=. read dom mon y <<-END
+ ${value}
+ END
+ ;;
+ *.*.) IFS=. read dom mon <<-END
+ ${value}
+ END
+ ;;
+ */*/*) IFS=/ read mon dom y <<-END
+ ${value}
+ END
+ ;;
+ */*) IFS=/ read mon dom <<-END
+ ${value}
+ END
+ ;;
+ *-*-*) IFS=- read y mon dom <<-END
+ ${value}
+ END
+ ;;
+ esac
+ [ ! "$y" ] && y="$(date +%Y)"
+ [ "$y" -gt 0 -a "$y" -lt 100 ] && y="$((y + 2000))"
+ date -d "${y}-${mon}-${dom}" + && printf %s:%s\\n "$key" "$(date -d "${y}-${mon}-${dom}" +%F)" \
+ || printf %s:\\n "$key"
+ ;;
+ *) printf %s:%s\\n "$key" "$(POST "$key" |sed ':X;N;$!bX; s;\n;\\n;g;')" ;;
+ esac
done >"$tempfile"
if [ "$(POST delete_session)" ]; then
fi
mv "$tempfile" "$tpyfile"
+rm -f "${_DATA}/cache/${tpy%%.*}.vcf.cache"
REDIRECT "/therapies/${tpy%.*}/${tpy#*.}"