logger.debug("Deleting mail...");
String[] mailArray = new String[0];
PrivateMessageForm pmForm = (PrivateMessageForm)form;
String memberId = token.getMemberId();
String privMsgsAction = pmForm.getPrivMsgsAction();
String privAdminDelete = StringUtil.safeString(pmForm.getPrivAdminDelete());
String privAdminMove = StringUtil.safeString(pmForm.getPrivAdminMove());
if ( privAdminDelete.equalsIgnoreCase("yes") || privAdminMove.equalsIgnoreCase("yes")){
// check to see if the user logged on is a member
if (!adminSecurityCheck(request, token)) {
return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
}
memberId = BaseConstants.ADMIN_USERNAME_ID;
}
mailArray = request.getParameterValues("messageId");
if (mailArray == null) {
ActionMessages errors = new ActionMessages();
errors.add(BaseConstants.WARN_KEY, new ActionMessage("error.selectOne"));
saveMessages(request, errors);
return mapping.getInputForward();
}
/**
* DELETE MAIL
*/
if (privMsgsAction.equalsIgnoreCase("delete")){
pmService.deleteMail(mailArray, memberId, getLastModifiedBy(request));
doMailDuties(token, request);
}
/**
* MOVE MAIL
*/
else if (privMsgsAction.equalsIgnoreCase("move")){
String toFolder = pmForm.getFolderName();
pmService.moveMail(mailArray, memberId, toFolder, getLastModifiedBy(request));
doMailDuties(token, request);
}
/**
* EMPTY TRASH