Fixes not possible to use dot character in username (#6737)

This commit is contained in:
MatteoBiscosi 2022-06-28 15:17:06 +02:00
parent 72622f9cdf
commit d63028efaa
5 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -57,7 +57,7 @@ const REGEXES = {
url: "^(https?\:\/\/[^\/\\s]+(\/.*)?)$",
emailUrl: "^smtps?:\/\/[-a-zA-Z0-9:.]{1,256}+$",
macAddress: "^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$",
username: "^(?=[a-zA-Z0-9._@!-?]{3,30}$)(?!.*[_.]{2})[^_.].*[^_.]$",
username: "^[a-zA-Z0-9._@!-?]{3,30}$",
singleword: "^(?=[a-zA-Z0-9._\-]{3,253}$)(?!.*[_.\-]{2})[^_.\-].*[^_.\-]$",
email: "^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)$",
https: "^https?://.+$",

View file

@ -260,7 +260,7 @@ end
local function validateUsername(p)
-- A username (e.g. used in ntopng authentication)
return(validateSingleWord(p) and (string.find(p, "%.") == nil))
return(validateSingleWord(p))
end
local function licenseCleanup(p)

View file

@ -3032,7 +3032,7 @@ end
function getUsernameInputPattern()
-- maximum len must be kept in sync with MAX_PASSWORD_LEN
return [[^(?=[a-zA-Z0-9._@!-?]{3,30}$)(?!.*[_.]{2})[^_.].*[^_.]$]]
return [[^[a-zA-Z0-9._@!-?]{3,30}$]]
end
function getPasswordInputPattern()