_EXEC="$(dirname "$real")" #execution directory
_DATA="$(dirname "$call")" #storage directory
-debug "Execution dir: $_EXEC"
-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
. "$_EXEC/cgi.sh"
cgi_get
-debug "$_GET"
-. "$_EXEC/page.sh"
+. "$_EXEC/constants.sh"
+
+if [ -n "$_GET[\"action\"]" ]; then
+ . "$_EXEC/action.sh"
+elif [ -n "$_GET[\"export\"]" ]; then
+ . "$_EXEC/export.sh"
+else
+ . "$_EXEC/page.sh"
+fi