From a0705c049d14ce6b2bdaa0ed05c5f8f9170ddfff Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 26 Nov 2016 18:26:14 +0100 Subject: [PATCH] include check to prevent adding username identical with static admin in ConfigAccounts_p --- htroot/ConfigAccounts_p.html | 2 ++ htroot/ConfigAccounts_p.java | 6 +++++- locales/master.lng.xlf | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htroot/ConfigAccounts_p.html b/htroot/ConfigAccounts_p.html index 77de2476e..0d8ade6a9 100644 --- a/htroot/ConfigAccounts_p.html +++ b/htroot/ConfigAccounts_p.html @@ -23,6 +23,8 @@

Passwords do not match.

::

Username too short. Username must be >= 4 Characters.

+ :: +

Username already used (not allowed).

#(/error)# #(passwordNotSetWarning)#::
No password is set for the administration account. Please define a password for the admin account.
#(/passwordNotSetWarning)# diff --git a/htroot/ConfigAccounts_p.java b/htroot/ConfigAccounts_p.java index ce975f801..d21ec6d4d 100644 --- a/htroot/ConfigAccounts_p.java +++ b/htroot/ConfigAccounts_p.java @@ -185,7 +185,11 @@ public class ConfigAccounts_p { prop.put("error", "2"); //PW does not match return prop; } - + // do not allow same username as staticadmin + if (username.equalsIgnoreCase(sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME,"admin"))) { + prop.put("error", "4"); + return prop; + } final String firstName = post.get("firstname"); final String lastName = post.get("lastname"); final String address = post.get("address"); diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index 6c75e9783..d337e90d8 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -843,6 +843,9 @@ Username too short. Username must be >= 4 Characters. + + Username already used (not allowed). + No password is set for the administration account.