try {
boolean announce = false;
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)); }
// check access rights if forum topics are locked
if (((currForum.getLocked() == IConst.Forum.STATUS_TOPICS_LOCKED) && messageForm
.getTid().equals(""))
&& (!isUserMod)) { return (mapping
.findForward(IConst.TOKEN.DENIED)); }
// insert new thread if it is necessary
if (messageForm.getTid().equals("")) {
messageForm.setTid(dao.insertNewThread(messageForm.getFid()));
announce = ((dao.isUserMod(user.getName()) || (user.getStatus() > 7)) && IConst.VALUES.TRUE
.equals(messageForm.getAnnounce()));
}
// check user access rights if current topic or completely forum is
// locked
if ((dao.getThreadInfo(Integer.parseInt(messageForm.getTid()))
.getLocked() == IConst.Topic.STATUS_LOCKED || currForum
.getLocked() == IConst.Forum.STATUS_COMPLETELY_LOCKED)
&& (!isUserMod)) { return (mapping
.findForward(IConst.TOKEN.DENIED)); }
// mark username for not registered users