From a6ae272ce0af6b93cabddf4aa4a3cebc7350f5a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 22 May 2022 13:12:52 +0200 Subject: [PATCH] basic revision listing --- handlers/20_revision.sh | 15 +++++++++++++++ macros/revisions | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 handlers/20_revision.sh create mode 100755 macros/revisions 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 '' -- 2.39.2