21,6 → 21,8 |
import ak.backpath.BackPath; |
|
import ak.hostcaptain.util.StringConverter; |
import ak.hostcaptain.util.UserException; |
import ak.hostcaptain.core.CoreResources; |
import ak.hostcaptain.core.model.User; |
import ak.hostcaptain.core.model.UserManager; |
import ak.hostcaptain.core.model.Mailbox; |
63,7 → 65,9 |
this, request, "ak.hostcaptain.core.form.MailboxEditForm"); |
|
if(boxId == null) { |
showForm.set("enabled", new Boolean(true)); |
showForm.set("enabled", new Boolean(true)); |
showForm.set("viruscheck", new Boolean(true)); |
showForm.set("spamcheck", new Boolean(true)); |
} |
else { |
Mailbox mailbox = MailboxManager.getInstance().get(user, boxId); |
100,7 → 104,7 |
|
if(boxId == null) { |
if(password == null || password.equals("")) |
throw new Exception("empty password"); // FIXME: exception type and message? |
throw new UserException(CoreResources.PASSWORD_REQUIRED); |
|
mailbox = MailboxManager.getInstance().create(user); |
|
113,7 → 117,7 |
mailbox.setLogin((String)theForm.get("login")); |
mailbox.setDomain(InetDomainManager.getInstance().get(user, |
StringConverter.parseLong(theForm.get("domain")))); |
mailbox.setOwner(UserManager.getInstance().get( |
mailbox.setOwner(UserManager.getInstance().get(user, |
StringConverter.parseLong(theForm.get("owner")))); |
mailbox.setVirusCheck((Boolean)theForm.get("viruscheck")); |
mailbox.setSpamCheck((Boolean)theForm.get("spamcheck")); |
144,7 → 148,7 |
private void initLists(HttpServletRequest request, User user) |
throws Exception |
{ |
List users = new ArrayList(UserManager.getInstance().listUsers()); |
List users = new ArrayList(UserManager.getInstance().listUsers(user)); |
Collections.sort(users, UserManager.LOGIN_COMPARATOR); |
request.setAttribute("users", users); |
|