| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private final String username;
|
| | |
|
| | | private final UserModel user;
|
| | |
|
| | | private final ServerSettings settings;
|
| | |
| | |
|
| | | public EditUserDialog(UserModel anUser, ServerSettings settings) {
|
| | | super();
|
| | | this.username = anUser.username;
|
| | | this.user = new UserModel("");
|
| | | this.settings = settings;
|
| | | this.usernames = new HashSet<String>();
|
| | |
| | | error(MessageFormat.format("Username ''{0}'' is unavailable.", uname));
|
| | | return false;
|
| | | }
|
| | | } else {
|
| | | // check rename collision
|
| | | if (!username.equalsIgnoreCase(uname)) {
|
| | | if (usernames.contains(uname.toLowerCase())) {
|
| | | error(MessageFormat.format(
|
| | | "Failed to rename ''{0}'' because ''{1}'' already exists.", username,
|
| | | uname));
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int minLength = settings.get(Keys.realm.minPasswordLength).getInteger(5);
|