HttpServletRequest request, HttpServletResponse response)
throws JGossipException {
HttpSession session = request.getSession();
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
ForumDAO dao = ForumDAO.getInstance();
ProcessAttachForm paForm = (ProcessAttachForm) form;
try {
boolean isUserMod = dao.checkMod(Integer.parseInt(paForm.getFid()),
user);
// check user access rights
getServlet().log("check user access rights ");
if (isUserMod) {
if(request.getAttribute("attachmentInfoForm")!=null){
return mapping.findForward(IConst.TOKEN.PAGE);
}
FileDataInfo fInfo = dao.getAttachmentInfo(Integer
.parseInt(paForm.getId()));
if (fInfo == null) {
StringBuffer forward = new StringBuffer();
forward.append("/ShowMessage.do?fid=");
forward.append(paForm.getFid());
forward.append("&tid=");
forward.append(paForm.getTid());
forward.append("&mid=");
forward.append(paForm.getMid());
return (new ActionForward(forward.toString(), true));
}
AttachmentInfoForm aiForm=new AttachmentInfoForm();
BeanUtils.copyProperties(aiForm,paForm);