From: Paul Hänsch Date: Sun, 22 May 2022 11:12:52 +0000 (+0200) Subject: basic revision listing X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=a6ae272ce0af6b93cabddf4aa4a3cebc7350f5a0;p=shellwiki basic revision listing --- diff --git a/handlers/20_revision.sh b/handlers/20_revision.sh new file mode 100644 index 0000000..a9c5d39 --- /dev/null +++ b/handlers/20_revision.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +case "${PATH_INFO}" in + */\[revision\]|*/\[revision\]/) + if ! acl_read "${PATH_INFO%\[revision\]?}"; then + theme_error 403 + else + theme_revisions "${PATH_INFO%\[revision\]?}" + fi + return 0 + ;; + */[revision]/*):;; +esac + +return 1 diff --git a/macros/revisions b/macros/revisions new file mode 100755 index 0000000..c6fb8fa --- /dev/null +++ b/macros/revisions @@ -0,0 +1,26 @@ +#!/bin/sh + +. "$_EXEC/cgilite/cgilite.sh" +. "$_EXEC/tools.sh" +. "$_EXEC/acl.sh" + +page="$1" +page_abs="$(page_abs "$page")" + +if ! acl_read "$page_abs"; then + return 0 +elif [ ! "$(which git)" ]; then + printf '
GIT is not available to handle revisioning.
' +fi + +printf ''