]> git.plutz.net Git - rawnet/blobdiff - index.cgi
For progress frame use chunked encoding instead of long poll
[rawnet] / index.cgi
index c5b1652ca4bf5eb10c4d0010fa92eb5752aaeb2e..76e3592a236f63bafe9d9171eae4cbe2db5373ed 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -7,8 +7,6 @@ USER_REQUIREEMAIL=false
 . "$_EXEC"/cgilite/session.sh nocookie
 . "$_EXEC"/cgilite/users.sh
 
-PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
-
 export MD_HTML="false"
 if [ "$(which awk)" ]; then
   markdown() { awk -f "$_EXEC/cgilite/markdown.awk"; }
@@ -98,6 +96,13 @@ case ${PATH_INFO} in
     fi
     ;;
   /register/)
+    if [ "$USER_ID" -a "$(GET user_register)" = confirm ]; then
+      printf 'Refresh: 2; url=%s\r\n' "/${_BASE#/}"
+      yield_page "RAW:NET Register confirm" "message register_confirm" <<-EOF
+       User registration successful!
+       EOF
+      exit 0
+    fi
     yield_page 'RAW:NET Register User' register <<-EOF
        $(w_user_register)
        EOF
@@ -108,15 +113,49 @@ case ${PATH_INFO} in
        EOF
     ;;
   /invite/)
+    if [ "$USER_ID" -a "$(GET user_register)" = confirm ]; then
+      printf 'Refresh: 2; url=%s\r\n' "/${_BASE#/}"
+      yield_page "RAW:NET Account activation" "message invite_confirm" <<-EOF
+       Account activation successful!
+       EOF
+      exit 0
+    fi
     yield_page 'RAW:NET Invite User' invite <<-EOF
+       [nav [a href="../" Channels] - [span Invite]]
        $(w_user_invite)
        EOF
     ;;
-  /video/*/*.mp4|/video/*/*_thumb.jpg)
+  /video/*/*.mp4|/video/*/*.webm|/video/*/*.jpg)
     . "${_EXEC}/cgilite/file.sh"
     FILE "${_DATA}/${PATH_INFO#/video/}"
     ;;
-  /|/channel/*) . "${_EXEC}/page_channel.sh";;
+  /channel/*/*/*)
+    action="${PATH_INFO##*/}"
+    video="${PATH_INFO%/*}" video="${video##*/}"
+    channel="${PATH_INFO#/channel/}" channel="${channel%%/*}"
+    . "$_EXEC/page_video.sh"
+    ;;
+  /channel/*/*/)
+    action=""
+    video="${PATH_INFO%/}" video="${video##*/}"
+    channel="${PATH_INFO#/channel/}" channel="${channel%%/*}"
+    . "$_EXEC/page_video.sh"
+    ;;
+  /channel/*/*)
+    action="${PATH_INFO##*/}"
+    video=""
+    channel="${PATH_INFO#/channel/}" channel="${channel%%/*}"
+    . "$_EXEC/page_channel.sh"
+    ;;
+  /channel/*/)
+    action=""
+    video=""
+    channel="${PATH_INFO#/channel/}" channel="${channel%%/*}"
+    . "$_EXEC/page_channel.sh"
+    ;;
+  /|/channel/)
+    . "${_EXEC}/page_channel.sh"
+    ;;
   /playlist/*) . "${_EXEC}/page_playlist.sh";;
   /search/*) . "${_EXEC}/page_search.sh";;
   *) . "${_EXEC}/page_404.sh";;