3 . "${_EXEC:-${0%/*}}/cgilite/cgilite.sh"
4 . "${_EXEC}/cgilite/session.sh"
5 . "${_EXEC}/cgilite/users.sh"
9 export REV_PAGES=${REV_PAGES:-true}
10 export REV_ATTACHMENTS=${REV_ATTACHMENTS:-false}
11 export WIKI_THEME="${WIKI_THEME:-default}"
13 which git >/dev/null || REV_PAGES=false
14 [ "$REV_PAGES" != true ] && REV_ATTACHMENTS=false
16 . "${_EXEC}/themes/${WIKI_THEME}.sh"
18 # Renew session cookie, only if cookie already set
19 [ "$(COOKIE session)" ] && SESSION_COOKIE
22 # Print source text of a wiki page
23 # Get page from data or underlay dir
24 local page="$(PATH "$1")" mdfile
26 mdfile="$(mdfile "$page")" || return 4
27 acl_read "$page" || return 3
31 if [ "$REV_PAGES" = true -a ! -f "$_DATA/.gitignore" ]; then
32 cat >"$_DATA/.gitignore" <<-EOF
42 [ "$REV_ATTACHMENTS" != true ] \
43 && printf '**/#attachments/\n' >>"$_DATA/.gitignore"
45 git -C "$_DATA" add .gitignore
46 printf '%s\n' "" "[user]" \
47 "email = \"shellwiki@localhost\"" \
48 "name = \"Shellwiki\"" \
49 >>"$_DATA/.git/config"
50 git -C "$_DATA" commit -m 'initialization' -- .gitignore
53 for handler in "$_EXEC"/handlers/*; do
57 export ERROR_MSG="The presented URL schema cannot be handled"