String passwd = parameters.substring(breakIndex + 1);
if (username.equals("") || passwd.equals("")) {
response = new RemoteManagerResponse("Usage: " + getHelp().getSyntax());
return response;
}
UsersRepository users = uStore.getRepository((String)session.getState().get(RemoteManagerSession.CURRENT_USERREPOSITORY));
boolean success = false;
if (users.contains(username)) {
StringBuilder responseBuffer =
new StringBuilder(64)
.append("User ")
.append(username)
.append(" already exists");
response = new RemoteManagerResponse(responseBuffer.toString());
return response;
} else {
if((username.indexOf("@") < 0) == false) {
if(mailServer.supportVirtualHosting() == false) {
response = new RemoteManagerResponse("Virtualhosting not supported");
return response;
}
String domain = username.split("@")[1];
if (domList.containsDomain(domain) == false) {
response = new RemoteManagerResponse("Domain not exists: " + domain);
return response;
}
}
success = users.addUser(username, passwd);
}
if ( success ) {
StringBuilder responseBuffer =
new StringBuilder(64)
.append("User ")