3 USER_REGISTRATION=false
4 USER_REQUIREEMAIL=false
6 . "${_EXEC:-${0%/*}}"/cgilite/cgilite.sh
7 . "$_EXEC"/cgilite/session.sh nocookie
8 . "$_EXEC"/cgilite/users.sh
10 PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
12 export MD_HTML="false"
13 if [ "$(which awk)" ]; then
14 markdown() { awk -f "$_EXEC/cgilite/markdown.awk"; }
16 markdown() { busybox awk -f "$_EXEC/cgilite/markdown.awk"; }
20 local check="$1"; shift 1;
22 if [ "$check" = "$comp" ] || [ "$check" -eq "$comp" ]; then
23 printf 'checked="checked"'
29 local check="$1"; shift 1;
31 if [ "$check" = "$comp" ] || [ "$check" -eq "$comp" ]; then
32 printf 'selected="selected"'
39 if [ ! "$USER_ID" ]; then
41 [form #user_login .login method=POST
43 [input name=uname placeholder="Username or Email" autocomplete=off]
44 [input type=password name=pw placeholder="Passphrase"]
45 [submit "action" "user_login" Login]
46 $([ "$USER_REGISTRATION" = true ] && printf '[a href="%s/register/" Register]' "$_BASE")
49 elif [ "$USER_ID" ]; then
51 [form #user_login .logout method=POST
52 [p Logged in as [span . $(HTML ${USER_NAME})]]
53 $([ "$USER_REGISTRATION" != true ] && printf '[a href="%s/invite/" Invite Friend]' "$_BASE")
54 [submit "action" "user_logout" Logout]
61 title="${1:-RAW:NET}" page="$2"
62 printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
63 "Content-Security-Policy: script-src 'none'" \
68 [meta name="viewport" content="width=device-width"]
69 [link rel="stylesheet" type="text/css" href="$_BASE/cgilite/common.css"]
70 [link rel="stylesheet" type="text/css" href="$_BASE/rawnet.css"]
71 [title . $(HTML "$title")]
74 [form method=POST action="$_BASE/search/"
75 [input name=search placeholder="Search"]
82 } |"$_EXEC/cgilite/html-sh.sed" -u
86 /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';;
88 . "${_EXEC}/cgilite/file.sh"
89 FILE "${_EXEC}/${PATH_INFO}"
92 if [ "$USER_ID" ]; then
95 yield_page 'RAW:NET Login' login <<-EOF
101 yield_page 'RAW:NET Register User' register <<-EOF
106 yield_page 'RAW:NET Recover Account' recover <<-EOF
111 . "${_EXEC}/cgilite/file.sh"
112 FILE "${_DATA}/${PATH_INFO#/video/}"
114 /|/channel/*) . "${_EXEC}/page_channel.sh";;
115 /playlist/*) . "${_EXEC}/page_playlist.sh";;
116 /search/*) . "${_EXEC}/page_search.sh";;
117 *) . "${_EXEC}/page_404.sh";;