6 . "$_EXEC/cgilite/logging.sh"
7 . "$_EXEC/cgilite/cgilite.sh"
8 . "$_EXEC/cgilite/session.sh"
9 . "$_EXEC/cgilite/storage.sh"
11 LOCATION="$(PATH "$PATH_INFO")"
12 LOCATION="${LOCATION#/}"
13 LOCATION="${LOCATION%%/*}"
17 printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
18 "Content-Security-Policy: script-src 'none'" \
22 [meta name="viewport" content="width=device-width"]
23 [link rel="stylesheet" type="text/css" href="/webchat.css"]
27 [ "$QUERY_STRING" = settings ] && settings_menu
30 } |"$_EXEC/cgilite/html-sh.sed" -u
35 [form #settings method="POST" action="?settings"
36 [hidden "session_key" "%s"]
37 [h1 Settings][a .settings href="?" Close]
40 printf '[p .error %s %s]' "${ERROR%% *}" "$(HTML "${ERROR#.* }")"
44 [a .section href="#nick" Nickname]
45 [div #nick [input name="nickname" value="%s"][submit "action" "nick" Set Cookie]]
46 ' "$(HTML "${nickname#\?}")"
48 [a .section href="#register" Register Nickname]
50 [p Registration will set a permanent Cookie in your Browser.
51 Registration requires neither a password, nor an email address.]
52 [input name="regnick" value="%s"][submit "action" "register" Register]
53 ]' "$(HTML "${nickname#\?}")"
57 . "$_EXEC/usernick.sh"
61 . "$_EXEC/cgilite/file.sh"
62 FILE "$_EXEC/${LOCATION}"
66 [ "$(COOKIE nick)" -o "$QUERY_STRING" = settings ] || REDIRECT "/$LOCATION?settings#nick"
67 chatfile="$_DATA/${LOCATION}/channel"
72 if [ -d "$_DATA/${LOCATION}" ]; then
73 chatfile="$_DATA/${LOCATION}/?${SESSION_ID}"
81 if [ -d "$_DATA/@${LOCATION#~}" ]; then
82 pubinfo="$_DATA/@${LOCATION#~}/pubinfo"
84 # ToDo Edit / Display of public user information
88 '') yield_page front <<-EOF