3 . "${_EXEC:-${0%/*}}"/cgilite/cgilite.sh
4 . "$_EXEC"/cgilite/session.sh
5 . "$_EXEC"/cgilite/file.sh
6 . "$_EXEC"/cgilite/storage.sh
9 # PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
11 # bookmarks_cookie="$(COOKIE bookmarks |grep -xE '[0-9a-zA-Z:=]{16}(/[0-9a-zA-Z:=]{16})?( [0-9a-zA-Z:=]{16}(/[0-9a-zA-Z:=]{16})?)*')"
13 for bm in $(COOKIE bookmarks); do
14 [ -f "${_DATA}/$(checkid "${bm%/*}")" ] && bookmarks="${bookmarks}${bookmarks:+ }${bm}"
16 if [ "$bookmarks" ]; then
17 SET_COOKIE +$((182 * 86400)) bookmarks="${bm}" Path="${_BASE}/"
21 title="${1:-Webpoll}" page="$2"
22 printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
23 "Content-Security-Policy: script-src 'none'" \
27 [meta name="viewport" content="width=device-width"]
28 [link rel="stylesheet" type="text/css" href="%s/common.css"]
29 [link rel="stylesheet" type="text/css" href="%s/widgets.css"]
30 [link rel="stylesheet" type="text/css" href="%s/webpoll.css"]
33 ' "$_BASE" "$_BASE" "$_BASE" "$(HTML "$title")" "$page"
36 } |"$_EXEC/cgilite/html-sh.sed" -u
41 local file="$_DATA/$id"
42 if [ -f "$file" ]; then
43 DBM "$file" get title || printf 'Unnamed Page'
49 page_home() { . "$_EXEC"/home.sh; }
50 page_newdate() { . "$_EXEC"/newdate.sh; }
51 page_poll() { . "$_EXEC"/poll.sh; }
54 /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';;
55 /common.css) FILE "$_EXEC/cgilite/common.css";;
56 /widgets.css|/webpoll.css) FILE "${_EXEC}/${PATH_INFO}";;
58 /[0-9a-zA-Z:=]???????????????/[0-9a-zA-Z:=]???????????????) page_newdate;;
60 /[0-9a-zA-Z:=]???????????????) page_poll;;