]> git.plutz.net Git - httpchat/blobdiff - index.cgi
display error messages for invalid nick changes
[httpchat] / index.cgi
index f44d288db0e41ba30f093e2a1c485424b61172ed..a5665c14796e542f2b61f6b610a07bdabd8e9322 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -32,13 +32,18 @@ yield_page(){
 
 settings_menu(){
   printf '
-    [form #settings method="POST" action="?"
+    [form #settings method="POST" action="?settings"
       [hidden "session_key" "%s"]
-      [h1 Settings][a .settings href="?" Close]'
+      [h1 Settings][a .settings href="?" Close]
+  ' "$SESSION_KEY"
+  if [ "$ERROR" ]; then
+    printf '[p .error %s %s]' "${ERROR%% *}" "$(HTML "${ERROR#.* }")"
+    unset ERROR
+  fi
   printf '
       [a .section href="#nick" Nickname]
       [div #nick [input name="nickname" value="%s"][submit "action" "nick" Set Cookie]]
-  ' "$SESSION_KEY" "$(HTML "${nickname#\?}")"
+  ' "$(HTML "${nickname#\?}")"
   printf '
       [a .section href="#register" Register Nickname]
       [div #register
@@ -75,6 +80,7 @@ case ${LOCATION} in
     if [ -d "$_DATA/@${LOCATION#~}" ]; then
       pubinfo="$_DATA/@${LOCATION#~}/pubinfo"
     else 
+      # ToDo Edit / Display of public user information
       REDIRECT /
     fi
     ;;