X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F10_page.sh;h=edb849ab24acb12b7ea644c8572768be404535f6;hb=a7cc6c21c6a90df07a66dc2ec3c14ccf3633416c;hp=0ebc2d028737979a84213bcdb89d54708eb7c583;hpb=c26134e76eb55e821d1b4340814b9b09c57e494d;p=shellwiki diff --git a/handlers/10_page.sh b/handlers/10_page.sh index 0ebc2d0..edb849a 100755 --- a/handlers/10_page.sh +++ b/handlers/10_page.sh @@ -36,6 +36,8 @@ wiki() { case "${PATH_INFO}" in /"[.]"/*) + # usually some file related to theme + # let file server handle errors FILE "${_EXEC}/${PATH_INFO#/\[.\]}" return 0 ;; @@ -49,11 +51,18 @@ case "${PATH_INFO}" in theme_error 400 return 0 ;; - */\[*\]/*) + */\[*\]/*|*/\[*\]) + # looks like some kind of handler return 1 ;; */) - theme_page "${PATH_INFO}" + if [ ! "$(mdfile "$page")" ]; then + theme_error 404 + elif ! acl_read "$page"; then + theme_error 403 + else + theme_page "${PATH_INFO}" + fi return 0 ;; esac