X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F10_page.sh;h=f8cbbafaae166c9f141af7d548c18f3a5cba47b5;hb=b0ccec5d3d972350accfc64149bf724c29bf577a;hp=99b79a43e8c70c5beabbf4b6d38882d96378aac7;hpb=190657ed71861114213d0bd8128bd157a69f17ff;p=shellwiki diff --git a/handlers/10_page.sh b/handlers/10_page.sh index 99b79a4..f8cbbaf 100755 --- a/handlers/10_page.sh +++ b/handlers/10_page.sh @@ -1,6 +1,7 @@ #!/bin/sh . "$_EXEC/cgilite/file.sh" +. "$_EXEC/css.sh" CACHE_AGE=${CACHE_AGE:-300} export MD_MACROS="$_EXEC/macros" @@ -36,6 +37,8 @@ wiki() { case "${PATH_INFO}" in /"[.]"/*) + # usually some file related to theme + # let file server handle errors FILE "${_EXEC}/${PATH_INFO#/\[.\]}" return 0 ;; @@ -49,15 +52,17 @@ case "${PATH_INFO}" in theme_error 400 return 0 ;; - */\[*\]/*) + */\[*\]/*|*/\[*\]) + # looks like some kind of handler return 1 ;; */) - if [ ! "$(mdfile "$page")" ]; then + if [ ! "$(mdfile "$PATH_INFO")" ]; then theme_error 404 - elif ! acl_read "$page"; then + elif ! acl_read "$PATH_INFO"; then theme_error 403 else + PAGE_CSS="$(css "${PATH_INFO}")" theme_page "${PATH_INFO}" fi return 0