X-Git-Url: http://git.plutz.net/?p=invoices;a=blobdiff_plain;f=invoices.cgi;h=bec02be117a48964f1a14c5b2ddb17bd3f5973ab;hp=76d989a0dffbee3c28ebb490dafcdba04c15d8c3;hb=HEAD;hpb=2be8dad1ce4b7b9915488511f5c43a1ad7788f8f diff --git a/invoices.cgi b/invoices.cgi index 76d989a..338f180 100755 --- a/invoices.cgi +++ b/invoices.cgi @@ -6,6 +6,8 @@ _EXEC="$(realpath "${0%/*}")" . "$_EXEC/cgilite/storage.sh" . "$_EXEC/cgilite/session.sh" +SESSION_COOKIE + yield_page(){ printf 'Content-Type: text/html; charset=utf-8\r\n\r\n' "$_EXEC/cgilite/html-sh.sed" <&- - 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 @@ -49,7 +42,7 @@ case $info in . "$_EXEC/cgilite/file.sh" FILE "$_EXEC/invoices.css" ;; - /clients) + /clients|/clients/) . "$_EXEC/clients.sh" { list_clients printf '[a .new href="/clients/%s" New]' "$(timeid)" @@ -63,7 +56,7 @@ case $info in . "$_EXEC/clients.sh" update_client ;; - /senders) + /senders|/senders/) . "$_EXEC/senders.sh" { list_senders printf '[a .new href="/senders/%s" New]' "$(timeid)" @@ -77,10 +70,10 @@ case $info in . "$_EXEC/senders.sh" update_sender ;; - /invoices) + /invoices|/invoices/) . "$_EXEC/invoices.sh" - { list_invoices - printf '[a .new href="/invoices/%s" New]' "$(timeid)" + { printf '[a .new href="/invoices/%s" New]' "$(timeid)" + list_invoices } | yield_page invoices ;; /invoices/*)