#!/bin/sh . "${_EXEC:-${0%/*}}/cgilite/cgilite.sh" . "${_EXEC}/cgilite/session.sh" . "${_EXEC}/cgilite/users.sh" . "${_EXEC}/tools.sh" . "${_EXEC}/acl.sh" WIKI_THEME="${WIKI_THEME:-default}" . "${_EXEC}/themes/${WIKI_THEME}.sh" wiki_text() { # Print source text of a wiki page # Get page from data or underlay dir local page="$(PATH "$1")" mdfile mdfile="$(mdfile "$page")" || return 4 acl_read "$page" || return 3 cat -- "$mdfile" } if [ "$(which git)" -a ! -f "$_DATA/.gitignore" ]; then cat >"$_DATA/.gitignore" <<-EOF users.db serverkey */#attachments/ */#cache/ */#page.lock */#page.*.cache */#page.*.cache.* EOF git init "$_DATA" git -C "$_DATA" add .gitignore git -C "$_DATA" commit -m 'initialization' -- .gitignore fi 1>&2 for handler in "$_EXEC"/handlers/*; do . "$handler" && break done if [ $? != 0 ]; then export ERROR_MSG="The presented URL schema cannot be handled" theme_error 400 fi