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
case "${PATH_INFO}" in
*/"[login]")
- theme_page "/[wiki]/login/"
+ acl_read "/wiki/login/" \
+ && theme_page "/[wiki]/login/" \
+ || theme_error 403
return 0
;;
*/"[register]")
- theme_page "/[wiki]/register/"
+ acl_read "/wiki/register/" \
+ && theme_page "/[wiki]/register/" \
+ || theme_error 403
return 0
;;
*/"[invite]")
- theme_page "/[wiki]/invite/"
+ acl_read "/wiki/invite/" \
+ && theme_page "/[wiki]/invite/" \
+ || theme_error 403
return 0
;;
*/"[settings]")
- theme_page "/[wiki]/settings/"
+ acl_read "/wiki/settings/" \
+ && theme_page "/[wiki]/settings/" \
+ || theme_error 403
return 0
;;
esac
case "${PATH_INFO}" in
*/\[*\]/*)
- theme_page "${PATH_INFO}"
+ if [ ! "$(mdfile "${PATH_INFO}")" ]; then
+ theme_error 404
+ elif ! acl_read "${PATH_INFO}"; then
+ theme_error 403
+ else
+ theme_page "${PATH_INFO}"
+ fi
return 0
;;
esac