3 _EXEC="${_EXEC:-${0%/*}/}"
7 . "$_EXEC"/cgilite/cgilite.sh
8 . "$_EXEC"/cgilite/session.sh
9 . "$_EXEC"/cgilite/file.sh
10 . "$_EXEC"/cgilite/storage.sh
11 #. "$_EXEC"/session_lock.sh
14 PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
16 # 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})?)*')"
18 for bm in $(COOKIE bookmarks); do
19 [ -f "${_DATA}/$(checkid "${bm%/*}")" ] && bookmarks="${bookmarks}${bookmarks:+ }${bm}"
21 if [ "$bookmarks" ]; then
22 SET_COOKIE +$((182 * 86400)) bookmarks="${bm}" Path="${_BASE}/"
26 title="${1:-Webpoll}" page="$2"
27 printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
28 "Content-Security-Policy: script-src 'none'" \
32 [meta name="viewport" content="width=device-width"]
33 [link rel="stylesheet" type="text/css" href="%s/common.css"]
34 [link rel="stylesheet" type="text/css" href="%s/widgets.css"]
35 [link rel="stylesheet" type="text/css" href="%s/webpoll.css"]
38 ' "$_BASE" "$_BASE" "$_BASE" "$(HTML "$title")" "$page"
41 } |"$_EXEC/cgilite/html-sh.sed" -u
46 local file="$_DATA/$id"
47 if [ -f "$file" ]; then
48 DBM "$file" get title || printf 'Unnamed Page'
54 page_home() { . "$_EXEC"/home.sh; }
55 page_newdate() { . "$_EXEC"/newdate.sh; }
56 page_poll() { . "$_EXEC"/poll.sh; }
59 /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';;
60 /common.css) FILE "$_EXEC/cgilite/common.css";;
61 /widgets.css|/webpoll.css) FILE "${_EXEC}/${PATH_INFO}";;
63 /[0-9a-zA-Z:=]???????????????/[0-9a-zA-Z:=]???????????????) page_newdate;;
65 /[0-9a-zA-Z:=]???????????????) page_poll;;