]> git.plutz.net Git - httpchat/blobdiff - usernick.sh
display error messages for invalid nick changes
[httpchat] / usernick.sh
index 8d62390b2d1872b91d8aa215b3c45c30defd39f1..3880fbe61972c6331b038ac3211b8ffbfa8ed925 100755 (executable)
@@ -4,7 +4,7 @@ UNAME_VALID='
   # Remove trailing CR, which may have been added by browser
   s;\r$;;;
   # Collapse white spaces
-  s;[\r\t\n ]+; ;;
+  s;[\r\t\n ]+; ;g;
   # Remove starting and trailing white spaces
   s;^ ;;; s; $;;;
   # Usernames starting with & # ? @ + will be invalid
@@ -47,8 +47,7 @@ case $(POST action) in
       SET_COOKIE +1209600 "nick=$(POST nickname |URL)"
       REDIRECT "$(URL "/$LOCATION")"
     else
-      # ToDo: Return Error Message
-      REDIRECT "$(URL "/$LOCATION")?settings#nick"
+      export ERROR=".nick This nickname has already been registered elsewhere"
     fi
     ;;
   register)
@@ -62,8 +61,7 @@ case $(POST action) in
       SET_COOKIE +"$((86400 * 365))" "nick=$(URL "${regnick}")"
       REDIRECT "$(URL "/$LOCATION")"
     else
-      # ToDo: Return Error Message
-      REDIRECT "$(URL "/$LOCATION")?settings#register"
+      export ERROR=".register This nickname has already been registered elsewhere"
     fi
     ;;
 esac