public ActionForward process(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws SystemException {
ProcessForumForm pfForm = (ProcessForumForm) form;
ForumDAO dao = ForumDAO.getInstance();
UserDAO userdao = UserDAO.getInstance();
HttpSession session = request.getSession();
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
int fid = Integer.parseInt(pfForm.getFid());
try {
Forum currForum = dao.getForumInfo(fid);
//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));
}
request.setAttribute(IConst.REQUEST.CURR_FORUM, currForum);
session.setAttribute(IConst.SESSION.CURR_FORUM, currForum);
RecordsData recordsData = new RecordsData();
dao.fillThreadList(user, recordsData, pfForm);
Iterator it = recordsData.getRecords().iterator();
while (it.hasNext()) {
Message mess = ((Topic) it.next()).getLastMessage();
mess.setSenderInfo(userdao.getSenderInfo(mess.getSender()));
}
request.setAttribute(IConst.REQUEST.RECORDS_DATA, recordsData);
if (dao.checkMod(fid, user)) {
request.setAttribute(IConst.REQUEST.MOD_FLAG, IConst.VALUES.TRUE);
}
} catch (SQLException sqle) {
getServlet().log("Connection.process", sqle);
throw new SystemException(sqle);