]> git.plutz.net Git - shellwiki/blobdiff - attachment.sh
page selector layout
[shellwiki] / attachment.sh
index 3b6e6c565aed8b3171895c8115dc65e65e4d7209..b88e4f47ceb4216df91745d4f646a5044112177b 100755 (executable)
@@ -78,7 +78,7 @@ if [ "${PATH_INFO%/\[attachment\]/}"  != "${PATH_INFO}" ]; then
       rm -- "$multipart_cachefile"
       printf 'Refresh: %i\r\n' 4
       theme_403
-      exit 0
+      return 0
     fi
 
     mkdir -p "$_DATA/pages/${PATH_INFO%/\[attachment\]/}/#attachments/"
@@ -93,16 +93,20 @@ if [ "${PATH_INFO%/\[attachment\]/}"  != "${PATH_INFO}" ]; then
     printf 'Refresh: %i\r\n' 4
     theme_403
     head -c $((CONTENT_LENGTH)) >/dev/null
+    return 0
   elif [ "$attachment_delete" -a "$SESSION_ID" = "$tsid" ]; then
     rm -- "$_DATA/pages/${PATH_INFO%/\[attachment\]/}/#attachments/$attachment_delete"
     REDIRECT "${_BASE}${PATH_INFO}"
   elif [ "$attachment_delete" ]; then
     printf 'Refresh: %i\r\n' 4
     theme_403
+    return 0
   elif acl_read "${PATH_INFO%\[attachment\]/}"; then
     theme_attachments "${PATH_INFO%\[attachment\]/}"
+    return 0
   else
     theme_404
+    return 0
   fi
 
 elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then
@@ -110,12 +114,16 @@ elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then
 
   if ! acl_read "${PATH_INFO%/\[attachment\]/*}"; then
     theme_403
+    return 0
   elif [ -f "$_DATA/pages/$attpath" ]; then
     FILE "$_DATA/pages/$attpath"
+    return 0
   elif [ -f "$_EXEC/pages/$attpath" ]; then
     FILE "$_EXEC/pages/$attpath"
+    return 0
   else
     theme_404
+    return 0
   fi
 #  exit 0;
   
@@ -124,13 +132,19 @@ elif [ "${PATH_INFO%/}" = "${PATH_INFO}" ]; then
 
   if ! acl_read "${PATH_INFO%/*}/"; then
     theme_403
+    return 0
   elif [ -f "$_DATA/pages/$attpath" ]; then
     FILE "$(attachment_convert "$_DATA/pages/$attpath")"
+    return 0
   elif [ -f "$_EXEC/pages/$attpath" ]; then
     FILE "$(attachment_convert "$_EXEC/pages/$attpath")"
+    return 0
   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
+    return 0
   fi
 fi
+
+return 1