]> git.plutz.net Git - httpchat/blobdiff - index.cgi
display error messages for invalid nick changes
[httpchat] / index.cgi
index 194ac98e3477de31d5343fa2827eeac690392865..a5665c14796e542f2b61f6b610a07bdabd8e9322 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -32,8 +32,14 @@ yield_page(){
 
 settings_menu(){
   printf '
-    [form #settings method="POST" action="?"
-      [h1 Settings][a .settings href="?" Close]'
+    [form #settings method="POST" action="?settings"
+      [hidden "session_key" "%s"]
+      [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]]
@@ -74,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
     ;;