61,16 → 61,18 |
else if("edit".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long boxId = StringConverter.parseLong(theForm.get("id")); |
Mailbox mailbox; |
DynaActionForm showForm = (DynaActionForm)RequestUtilsX.populateActionForm( |
this, request, "ak.hostcaptain.core.form.MailboxEditForm"); |
|
if(boxId == null) { |
mailbox = MailboxManager.getInstance().create(user); |
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); |
mailbox = MailboxManager.getInstance().get(user, boxId); |
showForm.set("login", mailbox.getLogin()); |
if(mailbox.getDomain() != null) |
showForm.set("domain", StringConverter.toString(mailbox.getDomain().getId())); |
85,7 → 87,11 |
} |
|
initLists(request, user); |
return mapping.findForward("default"); |
request.setAttribute("mailbox", mailbox); |
if(mailbox.editableBy(user)) |
return mapping.findForward("default"); |
else |
return mapping.findForward("view"); |
} |
else if("delete".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
103,8 → 109,10 |
String password = (String)theForm.get("password"); |
|
if(boxId == null) { |
if(password == null || password.equals("")) |
if(password == null || password.equals("")) { |
handleErrors(mapping, form, request, response); |
throw new UserException(CoreResources.PASSWORD_REQUIRED); |
} |
|
mailbox = MailboxManager.getInstance().create(user); |
|