config.json [usernameLength] moved to [userValidationConfig][usernameLength]

revert-70aa11f8
Rasika Perera 8 years ago
parent 2a7e62f857
commit 235b41c9df

@ -121,9 +121,9 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) {
} else { } else {
userRoles = String(addUserFormData.userRoles).split(","); userRoles = String(addUserFormData.userRoles).split(",");
} }
if (username.length < devicemgtProps.usernameLength) { if (username.length < devicemgtProps.userValidationConfig.usernameLength) {
log.error("Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"); log.error("Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long");
result = "Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"; result = "Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long";
} else { } else {
try { try {
result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles); result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles);

@ -30,8 +30,8 @@
"adminUser":"admin@carbon.super", "adminUser":"admin@carbon.super",
"adminUserTenantId":"-1234", "adminUserTenantId":"-1234",
"adminRole":"admin", "adminRole":"admin",
"usernameLength":30,
"userValidationConfig" : { "userValidationConfig" : {
"usernameLength":30,
"usernameJSRegEx" : "^[\\S]{3,30}$", "usernameJSRegEx" : "^[\\S]{3,30}$",
"usernameRegExViolationErrorMsg" : "Provided username is invalid.", "usernameRegExViolationErrorMsg" : "Provided username is invalid.",
"usernameHelpMsg" : "Should be in minimum 3 characters long and do not include any whitespaces.", "usernameHelpMsg" : "Should be in minimum 3 characters long and do not include any whitespaces.",

@ -33,7 +33,7 @@ function onRequest(context) {
viewModel["roles"] = response["content"]; viewModel["roles"] = response["content"];
} }
viewModel["charLimit"] = mdmProps["usernameLength"]; viewModel["charLimit"] = mdmProps["userValidationConfig"]["usernameLength"];
viewModel["usernameJSRegEx"] = mdmProps["userValidationConfig"]["usernameJSRegEx"]; viewModel["usernameJSRegEx"] = mdmProps["userValidationConfig"]["usernameJSRegEx"];
viewModel["usernameHelpText"] = mdmProps["userValidationConfig"]["usernameHelpMsg"]; viewModel["usernameHelpText"] = mdmProps["userValidationConfig"]["usernameHelpMsg"];
viewModel["usernameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["usernameRegExViolationErrorMsg"]; viewModel["usernameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["usernameRegExViolationErrorMsg"];

@ -40,7 +40,7 @@ function onRequest() {
} }
var userStores = userModule.getSecondaryUserStores(); var userStores = userModule.getSecondaryUserStores();
page["userStores"] = userStores; page["userStores"] = userStores;
page["charLimit"] = devicemgtProps["usernameLength"]; page["charLimit"] = devicemgtProps["userValidationConfig"]["usernameLength"];
page["usernameJSRegEx"] = devicemgtProps["userValidationConfig"]["usernameJSRegEx"]; page["usernameJSRegEx"] = devicemgtProps["userValidationConfig"]["usernameJSRegEx"];
page["usernameHelpMsg"] = devicemgtProps["userValidationConfig"]["usernameHelpMsg"]; page["usernameHelpMsg"] = devicemgtProps["userValidationConfig"]["usernameHelpMsg"];
page["usernameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["usernameRegExViolationErrorMsg"]; page["usernameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["usernameRegExViolationErrorMsg"];

Loading…
Cancel
Save