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