HttpServletRequest request, HttpServletResponse response)
throws SystemException {
HttpSession session = request.getSession();
MessageForm messageForm = (MessageForm) form;
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
ForumDAO dao = ForumDAO.getInstance();
try {
boolean isUserMod = dao.checkMod(Integer.parseInt(
messageForm.getFid()), user);
Forum currForum = dao.getForumInfo(Integer.parseInt(
messageForm.getFid()));
// check access rights if forum invisible
if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE) &&
(user.getStatus() < Integer.parseInt(
Configurator.getInstance().get(IConst.CONFIG.INVADER1)))) {
return (mapping.findForward(IConst.TOKEN.DENIED));
}
Topic currThread = dao.getThreadInfo(Integer.parseInt(
messageForm.getTid()));
// check user access rights if current topic or completely forum is locked
if (((currThread.getLocked() == IConst.Topic.STATUS_LOCKED) ||
(currForum.getLocked() == IConst.Forum.STATUS_COMPLETELY_LOCKED)) &&
(!isUserMod)) {
return (mapping.findForward(IConst.TOKEN.DENIED));
}
Message mess = dao.getMessage(messageForm.getMid());
session.removeAttribute(IConst.REQUEST.CURR_THREAD);
if (mess == null) {
return (new ActionForward("/ShowThread.do?fid=" +
messageForm.getFid() + "&tid=" + messageForm.getTid() +
"&block=" + messageForm.getBlock(), true));
} else {
// check user access rights
if (dao.checkMod(Integer.parseInt(messageForm.getFid()), user) ||
(user.getName().equals(mess.getSender()) &&
(currThread.getLocked() == IConst.Topic.STATUS_UNLOCKED))) {
dao.updateMessage(messageForm);
//subscribe user to e-mail from this thread...
if (IConst.VALUES.TRUE.equals(messageForm.getSubscribe())) {
dao.subscribe(messageForm.getTid(),
user.getInfo().getEmail(), user.getName());
}
log(request, "logs.LOG28",
" mid=" + messageForm.getMid() + " tid=" +