]> git.plutz.net Git - shellwiki/blobdiff - attachment.sh
generalized error pages
[shellwiki] / attachment.sh
index b88e4f47ceb4216df91745d4f646a5044112177b..0e9757e78f564a45a1a6097c99ec0b08861f38d6 100755 (executable)
@@ -77,7 +77,7 @@ if [ "${PATH_INFO%/\[attachment\]/}"  != "${PATH_INFO}" ]; then
     if [ "$USER_NAME" -a "$(multipart session_id)" != "$SESSION_ID" ]; then
       rm -- "$multipart_cachefile"
       printf 'Refresh: %i\r\n' 4
-      theme_403
+      theme_error 403
       return 0
     fi
 
@@ -91,7 +91,7 @@ if [ "${PATH_INFO%/\[attachment\]/}"  != "${PATH_INFO}" ]; then
     REDIRECT "${_BASE}${PATH_INFO}"
   elif [ "${CONTENT_TYPE%%;*}" = "multipart/form-data" ]; then
     printf 'Refresh: %i\r\n' 4
-    theme_403
+    theme_error 403
     head -c $((CONTENT_LENGTH)) >/dev/null
     return 0
   elif [ "$attachment_delete" -a "$SESSION_ID" = "$tsid" ]; then
@@ -99,13 +99,13 @@ if [ "${PATH_INFO%/\[attachment\]/}"  != "${PATH_INFO}" ]; then
     REDIRECT "${_BASE}${PATH_INFO}"
   elif [ "$attachment_delete" ]; then
     printf 'Refresh: %i\r\n' 4
-    theme_403
+    theme_error 403
     return 0
   elif acl_read "${PATH_INFO%\[attachment\]/}"; then
     theme_attachments "${PATH_INFO%\[attachment\]/}"
     return 0
   else
-    theme_404
+    theme_error 404
     return 0
   fi
 
@@ -113,7 +113,7 @@ elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then
   attpath="${PATH_INFO%/\[attachment\]/*}/#attachments/${PATH_INFO##*/}"
 
   if ! acl_read "${PATH_INFO%/\[attachment\]/*}"; then
-    theme_403
+    theme_error 403
     return 0
   elif [ -f "$_DATA/pages/$attpath" ]; then
     FILE "$_DATA/pages/$attpath"
@@ -122,7 +122,7 @@ elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then
     FILE "$_EXEC/pages/$attpath"
     return 0
   else
-    theme_404
+    theme_error 404
     return 0
   fi
 #  exit 0;
@@ -131,7 +131,7 @@ elif [ "${PATH_INFO%/}" = "${PATH_INFO}" ]; then
   attpath="${PATH_INFO%/*}/#attachments/${PATH_INFO##*/}"
 
   if ! acl_read "${PATH_INFO%/*}/"; then
-    theme_403
+    theme_error 403
     return 0
   elif [ -f "$_DATA/pages/$attpath" ]; then
     FILE "$(attachment_convert "$_DATA/pages/$attpath")"
@@ -142,7 +142,7 @@ elif [ "${PATH_INFO%/}" = "${PATH_INFO}" ]; then
   elif [ -d "$_DATA/pages/${PATH_INFO}" -o -d "$_EXEC/pages/${PATH_INFO}" ]; then
     REDIRECT "${_BASE}${PATH_INFO}/"
   elif [ "${PATH_INFO%\[*\]}" = "${PATH_INFO}" ]; then
-    theme_404
+    theme_error 404
     return 0
   fi
 fi