亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? replyaction.java

?? 個人Blog java編寫的Blog可以直接使用!
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 *  ReplyAction.java
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *  
 *  Author: Winter Lau
 *  http://dlog4j.sourceforge.net
 *  
 */
package com.liusoft.dlog4j.action;

import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.htmlparser.Node;
import org.htmlparser.Parser;

import com.liusoft.dlog4j.Globals;
import com.liusoft.dlog4j.HtmlNodeFilters;
import com.liusoft.dlog4j.MailTransportQueue;
import com.liusoft.dlog4j.base.ClientInfo;
import com.liusoft.dlog4j.base._ReplyBean;
import com.liusoft.dlog4j.beans.DiaryOutlineBean;
import com.liusoft.dlog4j.beans.DiaryReplyBean;
import com.liusoft.dlog4j.beans.PhotoOutlineBean;
import com.liusoft.dlog4j.beans.PhotoReplyBean;
import com.liusoft.dlog4j.beans.SiteBean;
import com.liusoft.dlog4j.beans.UserBean;
import com.liusoft.dlog4j.dao.DiaryDAO;
import com.liusoft.dlog4j.dao.PhotoDAO;
import com.liusoft.dlog4j.dao.ReplyDAO;
import com.liusoft.dlog4j.formbean.ReplyForm;
import com.liusoft.dlog4j.util.RequestUtils;
import com.liusoft.dlog4j.util.StringUtils;

import com.liusoft.dlog4j.util.MailSender;

/**
 * 評論操作相關的Action類
 * 
 * @author liudong
 */
public class ReplyAction extends ActionBase {

	private final static Log log = LogFactory.getLog(ReplyAction.class);
	
	/**
	 * 修改照片評論
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doUpdatePhotoReply(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		ReplyForm reply = (ReplyForm) form;
		//驗證客戶端安全識別碼
		validateClientId(request, reply);
		ActionMessages msgs = new ActionMessages();
		UserBean loginUser = super.getLoginUser(request, response);
		while (loginUser != null) {
			if (StringUtils.isEmpty(reply.getContent())) {
				msgs.add("reply", new ActionMessage("error.empty_not_allowed"));
				break;
			}
			SiteBean site = super.getSiteByID(reply.getSid());
			if (site == null) {
				msgs.add("reply", new ActionMessage("error.site_not_available"));
				break;
			}
			_ReplyBean rbean = ReplyDAO.getReply(PhotoReplyBean.class, reply
					.getReply_id());
			if (rbean!=null && rbean.getSite().getId() == site.getId()) {
				String content = StringUtils.abbreviate(super.autoFiltrate(
					null, reply.getContent()), MAX_REPLY_LENGTH);
				rbean.setContent(super.filterScriptAndStyle(content));
				rbean.setAuthor(reply.getAuthor());				
				rbean.setOwnerOnly(reply.getOwnerOnly());
				if (StringUtils.isNotEmpty(reply.getAuthorURL()))
					rbean.setAuthorURL(reply.getAuthorURL());
				if (StringUtils.isNotEmpty(reply.getAuthorEmail()))
					rbean.setAuthorEmail(reply.getAuthorEmail());
				ReplyDAO.updateReply(rbean);
			}
			break;
		}
		if (!msgs.isEmpty()) {
			saveMessages(request, msgs);
			return mapping.findForward("showphoto");
		}
		StringBuffer ext = new StringBuffer("pid=");
		ext.append(reply.getParentId());
		ext.append('#');
		ext.append(reply.getReply_id());
		return makeForward(mapping.findForward("showphoto"), reply.getSid(),
				ext.toString());
	}

	/**
	 * 修改日記評論
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doUpdateDiaryReply(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		ReplyForm reply = (ReplyForm) form;
		//驗證客戶端安全識別碼
		validateClientId(request, reply);
		ActionMessages msgs = new ActionMessages();
		UserBean loginUser = super.getLoginUser(request, response);
		while (loginUser != null) {
			if (StringUtils.isEmpty(reply.getContent())) {
				msgs.add("reply", new ActionMessage("error.empty_not_allowed"));
				break;
			}
			SiteBean site = super.getSiteByID(reply.getSid());
			if (site == null) {
				msgs.add("reply", new ActionMessage("error.site_not_available"));
				break;
			}
			_ReplyBean rbean = ReplyDAO.getReply(DiaryReplyBean.class, reply.getReply_id());
			if (rbean!=null && rbean.getSite().getId() == site.getId()) {
				String content = StringUtils.abbreviate(super.autoFiltrate(
						null, reply.getContent()), MAX_REPLY_LENGTH);
				rbean.setContent(super.filterScriptAndStyle(content));
				rbean.setAuthor(reply.getAuthor());				
				rbean.setOwnerOnly(reply.getOwnerOnly());
				if (StringUtils.isNotEmpty(reply.getAuthorURL()))
					rbean.setAuthorURL(reply.getAuthorURL());
				if (StringUtils.isNotEmpty(reply.getAuthorEmail()))
					rbean.setAuthorEmail(reply.getAuthorEmail());
				ReplyDAO.updateReply(rbean);
			}
			break;
		}
		if (!msgs.isEmpty()) {
			saveMessages(request, msgs);
			return mapping.findForward("showlog");
		}
		return makeForward(mapping.findForward("showlog"), reply.getSid(),
				"log_id", reply.getParentId());
	}

	/**
	 * 刪除照片評論
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doDeletePhotoReply(ActionMapping mapping,
			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;
		}
		
		String fromPage = reply.getFromPage();
		
		if (StringUtils.isNotEmpty(fromPage))
			return msgbox(mapping, form, request, response, msg, fromPage);
		return makeForward(mapping.findForward("photo"), reply.getSid());
	}

	/**
	 * 刪除日記評論
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doDeleteDiaryReply(ActionMapping mapping,
			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;
			}
			DiaryReplyBean rbean = (DiaryReplyBean) ReplyDAO.getReply(
					DiaryReplyBean.class, reply_id);
			if (rbean == null)
				break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区蜜臀亚洲| 欧美少妇bbb| 99久久婷婷国产综合精品| 成人激情综合网站| 国产成人超碰人人澡人人澡| 婷婷开心激情综合| 日韩精品午夜视频| 精品中文字幕一区二区小辣椒| 国产一区二区三区在线观看免费| 国产一区二区主播在线| 国产成人综合自拍| 91久久久免费一区二区| 欧美日韩成人一区| 国产精品入口麻豆九色| 亚洲欧美一区二区久久| 爽好久久久欧美精品| 国产成人午夜电影网| 欧美亚洲动漫另类| 中文字幕巨乱亚洲| 午夜精品久久久久久久| 国产盗摄精品一区二区三区在线 | 成人白浆超碰人人人人| 欧美中文字幕一区二区三区亚洲| 精品国产免费久久| 午夜精品久久久久久| 成人国产电影网| 国产亚洲午夜高清国产拍精品| 一区二区三区日韩在线观看| 美女在线一区二区| 成人午夜视频福利| 久久精品视频免费| 国产最新精品精品你懂的| 欧美日韩精品一二三区| 亚洲精品乱码久久久久久久久| 国产一区二区三区高清播放| 337p亚洲精品色噜噜狠狠| 亚洲精品国产视频| 欧美四级电影网| 亚洲与欧洲av电影| 欧美性做爰猛烈叫床潮| 亚洲一区在线观看视频| 欧美日韩精品三区| 欧美一区二区三区视频在线| 久久午夜羞羞影院免费观看| 欧美欧美欧美欧美首页| 另类小说色综合网站| 色婷婷激情久久| 欧美一区二区三级| 国产精品久久久久久亚洲毛片| 国产色91在线| 石原莉奈在线亚洲三区| 国产福利一区二区三区视频在线 | 国产精品白丝在线| 五月天一区二区| 精品无人区卡一卡二卡三乱码免费卡 | 日韩中文字幕区一区有砖一区| 美脚の诱脚舐め脚责91| 91亚洲精品乱码久久久久久蜜桃| 欧美日韩精品电影| 亚洲精品日日夜夜| 国产精品亚洲午夜一区二区三区 | 成人免费毛片嘿嘿连载视频| 欧美视频三区在线播放| 欧美激情一区二区三区在线| 秋霞成人午夜伦在线观看| 91在线观看污| 一区二区中文字幕在线| 国产精品亚洲综合一区在线观看| 制服丝袜国产精品| 久久99国产精品久久99| 欧美丰满少妇xxxxx高潮对白 | 91麻豆精品国产91久久久久| 亚洲精品欧美在线| 国产成人精品亚洲午夜麻豆| 欧美日韩中文精品| 337p粉嫩大胆色噜噜噜噜亚洲| 国产亚洲精品中文字幕| 日韩美女精品在线| 国产精品系列在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 欧美日韩免费一区二区三区 | 首页国产欧美久久| 久久99精品国产麻豆婷婷| 欧美日韩国产综合视频在线观看 | 日本不卡的三区四区五区| 日韩亚洲欧美成人一区| 欧美精品一区二区三| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 日韩精品一区二区三区四区 | 亚洲色图视频网| 日韩一区二区三区视频| 国产福利视频一区二区三区| 久久久久久久电影| 欧美午夜理伦三级在线观看| 欧美美女黄视频| 精品福利二区三区| 久久综合九色欧美综合狠狠| 亚洲欧美aⅴ...| 亚洲日本一区二区| 三级欧美在线一区| 日本二三区不卡| 中文字幕不卡的av| 91欧美一区二区| 亚洲成人激情社区| 欧美久久久久久蜜桃| 亚洲欧美电影院| 精品亚洲欧美一区| 日韩欧美精品在线视频| 国内精品视频666| 精品久久久三级丝袜| 91网站最新网址| 奇米四色…亚洲| 日韩国产欧美在线观看| 久久久777精品电影网影网| 欧美日韩国产美女| 国产精品亚洲人在线观看| 2024国产精品| 欧美日韩一区国产| 欧洲精品在线观看| 国产成人午夜片在线观看高清观看| 亚洲香肠在线观看| 最新热久久免费视频| 欧美激情一区二区三区不卡| 精品捆绑美女sm三区| 欧美一级高清大全免费观看| 丁香婷婷综合色啪| 国产在线视视频有精品| 久久精品国产77777蜜臀| 五月激情丁香一区二区三区| 日韩理论片在线| 中文字幕在线观看一区二区| 中文字幕av一区二区三区| 国产呦萝稀缺另类资源| 国产成人久久精品77777最新版本| 欧美综合色免费| 国产午夜精品久久久久久免费视| 亚洲成国产人片在线观看| 久草中文综合在线| 欧美福利电影网| 日韩精品一卡二卡三卡四卡无卡| 粗大黑人巨茎大战欧美成人| 欧美变态口味重另类| 日韩精品久久理论片| 欧美日韩不卡一区二区| 一区二区三区色| 欧美网站大全在线观看| 亚洲欧美视频在线观看| 97国产一区二区| 最新国产精品久久精品| 亚洲妇女屁股眼交7| 99精品国产99久久久久久白柏| 精品在线视频一区| 久久亚洲精华国产精华液| 欧美激情自拍偷拍| 水蜜桃久久夜色精品一区的特点| 韩国成人在线视频| 91久久久免费一区二区| 国产精品久久久久久亚洲毛片 | 精品久久久久久无| 中文字幕亚洲在| 久久99精品视频| 精品国产髙清在线看国产毛片| 伊人一区二区三区| 99久久久久久| 亚洲欧洲99久久| 不卡视频在线看| 中文字幕高清不卡| 粉嫩av一区二区三区在线播放 | 午夜影院在线观看欧美| 国产高清不卡一区| 国产精品丝袜在线| 97精品久久久久中文字幕| 久久精品水蜜桃av综合天堂| 国产美女久久久久| 中文字幕不卡三区| 99精品视频一区二区| 亚洲天天做日日做天天谢日日欢| 国产成人精品影视| 国产精品不卡一区二区三区| 色美美综合视频| 一区二区久久久久久| 欧美日韩电影在线播放| 奇米四色…亚洲| 国产拍揄自揄精品视频麻豆| 9l国产精品久久久久麻豆| 伊人性伊人情综合网| 欧美卡1卡2卡| 丁香激情综合国产| 午夜精品久久一牛影视| 久久一区二区三区四区| 欧美一区日本一区韩国一区| 成人免费高清视频在线观看| 免费人成精品欧美精品| 亚洲国产一区二区三区青草影视| 久久久久久久久蜜桃| 精品国产污污免费网站入口| 欧美一级在线免费| 91精品国产欧美日韩| 欧美午夜在线观看| 欧美一区二区三区在线观看|