From: Paul Hänsch Date: Fri, 1 Dec 2023 11:47:25 +0000 (+0100) Subject: use _BASE url X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=f25e396a0fbae6e8969600e033d2b0f7876834f3;p=invoices use _BASE url --- diff --git a/doclist.sh b/doclist.sh index 44ba533..41948a9 100644 --- a/doclist.sh +++ b/doclist.sh @@ -15,7 +15,7 @@ list_status() { cat <<-EOF [form .invoice method=POST - [h3 [a href="/doc/${id}" . $(DB3 get invnum |HTML)]] + [h3 [a href="${_BASE}/doc/${id}" . $(DB3 get invnum |HTML)]] [span .date . $(DB3 get date |HTML)] [span .rcpt . $(DB3 get rcpt |HTML)] [span .total . ${gross} €] diff --git a/form.sh b/form.sh index 28c7489..1c563d3 100755 --- a/form.sh +++ b/form.sh @@ -10,7 +10,7 @@ yield_form() { [link rel="stylesheet" type="text/css" href="/cgilite/common.css"] [title $(_ Invoices)] ] [body - [a href=/ . <--] + [a href="${_BASE}" . <--] [form .document .default method=POST [label for=type . $(_ Type):] [select #type name=type diff --git a/invoices.cgi b/index.cgi similarity index 91% rename from invoices.cgi rename to index.cgi index 6313a88..f2feca3 100755 --- a/invoices.cgi +++ b/index.cgi @@ -31,7 +31,7 @@ serverkey' >.gitignore DB3 set type "$(POST type)" DB3 set status open DB3 write "$file" - REDIRECT "/doc/${id}" + REDIRECT "${_BASE}/doc/${id}" ;; update_invoice|update_invoice_return) id="$(POST id)" file="$_DATA/${id}.kvd" seq='' @@ -56,9 +56,9 @@ serverkey' >.gitignore debug "TID mismatch updating $file" fi if [ $(POST action) = update_invoice_return ]; then - REDIRECT / + REDIRECT "${_BASE}" else - REDIRECT "$PATH_INFO" + REDIRECT "${_BASE}$PATH_INFO" fi ;; pdf_export) @@ -78,10 +78,10 @@ serverkey' >.gitignore rm -- "export/${id}"_*.pdf "export/doc_data.txt" fi rm -- "export/${id}.html" - REDIRECT "/pdf/${id}/$(URL "${filenamestring}.pdf")" + REDIRECT "${_BASE}/pdf/${id}/$(URL "${filenamestring}.pdf")" ;; *) - REDIRECT / + REDIRECT "${_BASE}" ;; esac @@ -94,7 +94,7 @@ esac ;; /doc/*) id="${PATH_INFO##*/}" tid="$(transid "${_DATA}/${id}.kvd")" - DB3 open "${_DATA}/${id}.kvd" || REDIRECT / + DB3 open "${_DATA}/${id}.kvd" || REDIRECT "${_BASE}" type="$(DB3 get type)" [ -d "${_EXEC}/${type}/" ] \ && . "${_EXEC}/${type}/form.sh" @@ -104,6 +104,6 @@ esac id="${PATH_INFO#/pdf/}" id="${id%%/*}" FILE "$_DATA/export/${id}.pdf" ;; - *) REDIRECT / + *) REDIRECT "${_BASE}" ;; esac