HttpServletRequest request, HttpServletResponse response)
throws SystemException {
HttpSession session = request.getSession();
MessageForm messageForm = new MessageForm();
ForumDAO dao = ForumDAO.getInstance();
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
ProcessMessageForm pmForm = (ProcessMessageForm) form;
try {
int fid = Integer.parseInt(pmForm.getFid());
boolean isUserMod = dao.checkMod(fid, user);
Topic currThread = dao.getThreadInfo(Integer.parseInt(pmForm
.getTid()));
Message mess = dao.getMessage(pmForm.getMid());
if (mess == null) {
return (new ActionForward("/ShowThread.do?fid="
+ pmForm.getFid() + "&tid=" + pmForm.getTid()
+ "&block=" + pmForm.getBlock(), true));
} else {
// check user access rights
getServlet().log("check user access rights ");
if (isUserMod
|| (user.getName().equals(mess.getSender()) && (currThread
.getLocked() == IConst.Topic.STATUS_UNLOCKED))) {
return super.process(mapping, form, request, response);
} else {
return (mapping.findForward(IConst.TOKEN.DENIED));
}