ActionForm form, HttpServletRequest request,
HttpServletResponse response, String s_reply_id) throws Exception {
String msg = null;
ReplyForm reply = (ReplyForm) form;
int reply_id = Integer.parseInt(s_reply_id);
UserBean loginUser = super.getLoginUser(request, response);
while (loginUser != null) {
SiteBean site = super.getSiteByID(reply.getSid());
if (site == null) {
msg = getMessage(request, null, "error.site_not_available");
break;
}
PhotoReplyBean rbean = (PhotoReplyBean) ReplyDAO.getReply(
PhotoReplyBean.class, reply_id);
if (rbean == null)
break;
if (rbean.getSite().getId() != reply.getSid()) {
msg = getMessage(request, null, "error.param");
break;
}
if (!site.isOwner(loginUser)
&& !isReplyBelongToUser(rbean, loginUser.getId())) {
msg = getMessage(request, null, "error.access_deny");
break;
}
PhotoDAO.deletePhotoReply(rbean);
break;