throws SystemException {
ForumDAO dao = ForumDAO.getInstance();
HttpSession session = request.getSession();
ActionErrors errors = new ActionErrors();
MessageResources messages = getResources(request);
SubscribeForm sForm = (SubscribeForm) form;
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
String uname = null;
String inputForward = null;
String email = null;
if (user.getStatus() == 0) {
inputForward = "unsubscribe";
if ((sForm.getEmail() == null) || sForm.getEmail().equals("")) {
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
"errors.required", new Object[]{messages
.getMessage("user.U_MAIL")}));
saveErrors(request, errors);
return (mapping.findForward(inputForward));
} else {
email = sForm.getEmail();
uname = "<%>";
}
} else {
inputForward = "subscriptions";
uname = user.getName();
email = user.getInfo().getEmail();
}
try {
if (dao.unsubscribe(email, uname, sForm.getTid())) {
if (user.getStatus() == 0) {
setStatusMessage(request, "mails.OK1");
}
} else if (user.getStatus() == 0) {
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(