X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=themes%2Fdefault.sh;h=7edd4b9986c60ad8e989f07a2740c7dc327d7c48;hb=7b1d88cf33d962e2ac98e03d0fd21327aee583a6;hp=56b57aed24eb505669d742cca13fde2f9660ae3f;hpb=5188614dbad08cce02ab53910d9252b0007f228f;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index 56b57ae..7edd4b9 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -1,9 +1,12 @@ #!/bin/sh +. "$_EXEC/tools.sh" + theme_head(){ printf ' + ' "$_BASE" } @@ -19,7 +22,15 @@ theme_page(){ local page="$1" title title="${page%/}"; title="${title##*/}" - # Important! Web Server response including newline newline + if [ ! "$(mdfile "$page")" ]; then + theme_404 + return 0 + elif ! acl_read "$page"; then + theme_403 + return 0 + fi + + # Important! Web Server response including newline printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" cat <<-EOF @@ -29,7 +40,17 @@ theme_page(){