X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=themes%2Fdefault.sh;h=3c5f2a1819a000277c06dc31451a2013f1335812;hb=fb2b12ba32dc26c47e6620f2155c6d63e7b592a6;hp=c096f8218a03639d6b24352c4ed4228df515993d;hpb=1915ebd8eeacf71975e39f7280110bd00992aa20;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index c096f82..3c5f2a1 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_error 404 + return 0 + elif ! acl_read "$page"; then + theme_error 403 + return 0 + fi + + # Important! Web Server response including newline printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" cat <<-EOF @@ -29,16 +40,33 @@ theme_page(){