From 53de77e6d3528e016290821c5d1186788cf361e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 30 May 2019 14:07:33 +0200 Subject: [PATCH] allow use in fake proxy, replace tid function with new equivalent from library --- cgilite | 2 +- clients.sh | 4 ++-- invoices.cgi | 11 +---------- invoices.sh | 4 ++-- senders.sh | 4 ++-- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/cgilite b/cgilite index 2638ffc..506e2f9 160000 --- a/cgilite +++ b/cgilite @@ -1 +1 @@ -Subproject commit 2638ffcf8dc901606f3cdb249fab75e14ca47875 +Subproject commit 506e2f9f146c13919e65a9bbbd844391b96bbe9d diff --git a/clients.sh b/clients.sh index 8e6713c..052a0c8 100755 --- a/clients.sh +++ b/clients.sh @@ -19,7 +19,7 @@ edit_client(){ "$(HTML $id)" \ "$(UNSTRING "${address#address=}" |HTML)" \ "$(UNSTRING "${hourly#hourly=}" |grep -xE '[0-9]+')" \ - "$(tid "clients/$id")" + "$(transid "clients/$id")" } list_clients(){ @@ -40,7 +40,7 @@ list_clients(){ update_client(){ local id="$(POST id |checkid)" - if [ "$(POST update)" = "$(tid "clients/$id")" ]; then + if [ "$(POST update)" = "$(transid "clients/$id")" ]; then mkdir -p clients printf 'address=%s hourly=%s' \ "$(POST address |STRING)" "$(POST hourly |STRING)" \ diff --git a/invoices.cgi b/invoices.cgi index 76d989a..464d284 100755 --- a/invoices.cgi +++ b/invoices.cgi @@ -24,16 +24,7 @@ printf 'Content-Type: text/html; charset=utf-8\r\n\r\n' EOF } -tid(){ - # transaction ID to modify a given file - local file="$1" - { stat -c %F%i%n%N%s%Y "$file" 2>&- - printf %s "$SESSION_ID" - server_key - } | sha256sum | cut -d\ -f1 -} - -info="$(PATH "${PATH_INFO}")" +info="$(PATH "${PATH_INFO#http://*/}")" which git && [ ! -d .git ] && { git init diff --git a/invoices.sh b/invoices.sh index c21fe4f..b97c6e7 100755 --- a/invoices.sh +++ b/invoices.sh @@ -95,7 +95,7 @@ edit_invoice(){ && hourly="${hourly#hourly=}" \ || hourly="${chourly}" - tid="$(tid "invoices/$id")" + tid="$(transid "invoices/$id")" read -r taxtype nett tax gross x<<-EOF $(invoice_total "$id") @@ -215,7 +215,7 @@ invoice_total(){ update_invoice(){ local id="$(POST id |checkid)" extra=0 tid - tid="$(tid invoices/$id)" + tid="$(transid invoices/$id)" if [ "$(POST update)" = "$tid" ] || [ "$(POST genpdf)" = "$tid" ]; then mkdir -p invoices diff --git a/senders.sh b/senders.sh index a4ff71f..757ce22 100755 --- a/senders.sh +++ b/senders.sh @@ -30,7 +30,7 @@ xxx / 000 / ### ]' \ "$(HTML $id)" "$(HTML "${address}")" \ "$(HTML "${iban}")" "$(HTML "${bic}")" \ - "$(tid "senders/$id")" + "$(transid "senders/$id")" } list_senders(){ @@ -49,7 +49,7 @@ list_senders(){ update_sender(){ id="$(POST id |checkid)" - if [ "$(POST update)" = "$(tid "senders/$id")" ]; then + if [ "$(POST update)" = "$(transid "senders/$id")" ]; then mkdir -p senders printf 'address=%s iban=%s bic=%s\n' \ $(POST address |STRING) $(POST iban |STRING) \ -- 2.39.2