]> git.plutz.net Git - shellwiki/blob - handlers/90_brackets.sh
move acl checks from theme to handlers
[shellwiki] / handlers / 90_brackets.sh
1 #!/bin/sh
2
3 # spacial case for bracket pages that are not handled otherwise
4 # attachment and edit (and really all) handlers should take precedence
5
6 case "${PATH_INFO}" in
7   */\[*\]/*)
8     if [ ! "$(mdfile "${PATH_INFO}")" ]; then
9       theme_error 404
10     elif ! acl_read "${PATH_INFO}"; then
11       theme_error 403
12     else
13       theme_page "${PATH_INFO}"
14     fi
15     return 0
16     ;;
17 esac
18
19 return 1