Allow user names up to 40 chars & allow reserved names

This commit is contained in:
bergware
2020-04-07 20:47:41 +02:00
parent 747e8aa492
commit f98494aa34

View File

@@ -62,10 +62,6 @@ function checkUsername(form) {
swal({title:"_(Invalid user name)_",text:"_(Use only lowercase letters, digits, underscores and dashes)_",type:"error",confirmButtonText:'_(Ok)_'});
return false;
}
if (username.match('^(disk[0-9]+|cache[0-9]*|parity[0-9]*|flash)$')) {
swal({title:"_(Invalid user name)_",text:"_(Do not use reserved names)_",type:"error",confirmButtonText:'_(Ok)_'});
return false;
}
if (form.userPasswordGUI.value.length > 128 || form.userPasswordConfGUI.value.length > 128) {
swal({title:"_(Password too long)_",text:"_(Use a password up to 128 characters)_",type:"error",confirmButtonText:'_(Ok)_'});
return false;
@@ -163,10 +159,10 @@ $(function(){
<form markdown="1" name="user_edit" method="POST" action="/update.htm" target="progressFrame" onsubmit="return checkUsername(this)">
_(User name)_:
: <input type="text" name="userName" maxlength="32" onKeyUp="this.form.cmdUserEdit.disabled=(this.form.userName.value=='')" pattern="^[a-z_][a-z0-9_-]*[$]?$">
: <input type="text" name="userName" maxlength="40" onKeyUp="this.form.cmdUserEdit.disabled=(this.form.userName.value=='')" pattern="^[a-z_][a-z0-9_-]*[$]?$">
:help1
> Usernames may be up to 32 characters long and must start with a **lower case letter** or an underscore,
> Usernames may be up to 40 characters long and must start with a **lower case letter** or an underscore,
> followed by **lower case letters**, digits, underscores, or dashes. They can end with a dollar sign.
:end