LOCATION="${LOCATION%%/*}"
NICK_REGISTRATION="${NICK_REGISTRATION:-on}"
+CHANNEL_LIST="${ALLOW_LIST:-off}"
# ToDo:
# COOKIE_NICK_EXPIRE=$((86400 * 14))
REDIRECT /
fi
;;
- '') yield_page front <<-EOF
- Front
+ '')
+ if [ "$(POST action)" = join ]; then
+ REDIRECT "./&$(POST channel |URL)"
+ else
+ yield_page front <<-EOF
+ [h1 Webchat]
+ [form method=POST
+ [label Join Channel: [input name=channel value='' placeholder="Name of Channel"][button type=submit name=action value=join Join]]
+ ]
+ $(if [ "$CHANNEL_LIST" = on ]; then
+ printf '[h2 Existing channels][div #channels'
+ $(for chan in "$_DATA/&"*; do
+ printf '[a href="./%s" . %s]\n' "$(HTML "${chan##*/}")" "$(HTML "${chan##*/}")"
+ done)
+ printf ']'
+ fi)
EOF
+ fi
;;
*) REDIRECT /
;;