]> git.plutz.net Git - shellwiki/blob - index.cgi
variable theming
[shellwiki] / index.cgi
1 #!/bin/sh
2
3 . "${_EXEC:-${0%/*}}/cgilite/cgilite.sh"
4 . "${_EXEC}/cgilite/session.sh"
5 . "${_EXEC}/cgilite/users.sh"
6 . "${_EXEC}/tools.sh"
7 . "${_EXEC}/acl.sh"
8
9 WIKI_THEME="${WIKI_THEME:-default}"
10 . "${_EXEC}/themes/${WIKI_THEME}.sh"
11
12 wiki_text() {
13   # Print source text of a wiki page
14   # Get page from data or underlay dir
15   local page="$(PATH "$1")" mdfile
16
17   mdfile="$(mdfile "$page")" || return 4
18   acl_read "$page" || return 3
19   cat -- "$mdfile"
20 }
21
22 for handler in "$_EXEC"/handlers/*; do
23   . "$handler" && break
24 done
25
26 if [ $? != 0 ]; then
27   export ERROR_MSG="The presented URL schema cannot be handled"
28   theme_error 400
29 fi