📄 manage.java
字号:
package com.laoer.bbscs.web.action;
import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.web.servlet.*;
import com.laoer.bbscs.sys.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;
/**
* <p>Title: TianYi BBS</p>
* <p>Description: TianYi BBS System</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: LAOER.COM/TIANYISOFT.NET</p>
* @author laoer
* @version 6.0
*/
public class Manage
extends BaseAction {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
ActionErrors errors = new ActionErrors();
ForumForm form = (ForumForm) actionForm;
UserCheck uc = this.getUserCheck(httpServletRequest, httpServletResponse,
form.getBid());
if (uc.isGuest()) {
errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
saveErrors(httpServletRequest, errors);
//return actionMapping.findForward("login");
return SysUtil.getPassLogin(actionMapping);
}
if (uc.getBs() == null) {
errors.add("error.baordsno", new ActionError("error.baordsno"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
if (!uc.isCanPostNotNeedExp()) {
errors.add("error.purviewerror", new ActionError("error.purviewerror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
if (form.getAction().equals("m")) {
Pages pages = new Pages(httpServletRequest);
pages.setPage(form.getPage());
pages.setPerPageNum(40);
pages.setFileName("manage" + Constant.FILEPREFIX + "?action=m&bid=" +
form.getBid());
pages.setStyle(1);
PageList pl = getForumService().getForumAllList(form.getBid(), (short) 0,
(short) 0, pages);
PostsForm postsForm = new PostsForm();
postsForm.setBid(form.getBid());
postsForm.setPage(form.getPage());
postsForm.setAction("dels");
httpServletRequest.setAttribute("bid", String.valueOf(form.getBid()));
httpServletRequest.setAttribute("pl", pl);
httpServletRequest.setAttribute("uc", uc);
httpServletRequest.setAttribute("postsForm", postsForm);
return actionMapping.findForward("manage");
}
if (form.getAction().equals("a")) {
Pages pages = new Pages(httpServletRequest);
pages.setPage(form.getPage());
pages.setPerPageNum(40);
pages.setFileName("manage" + Constant.FILEPREFIX + "?action=m&bid=" +
form.getBid());
pages.setStyle(1);
PageList pl = getForumService().getForumAllList(form.getBid(), (short) 0,
(short) 1, pages);
PostsForm postsForm = new PostsForm();
postsForm.setBid(form.getBid());
postsForm.setPage(form.getPage());
postsForm.setAction("auditing");
httpServletRequest.setAttribute("bid", String.valueOf(form.getBid()));
httpServletRequest.setAttribute("pl", pl);
httpServletRequest.setAttribute("uc", uc);
httpServletRequest.setAttribute("postsForm", postsForm);
httpServletRequest.setAttribute("pages", String.valueOf(form.getPage()));
return actionMapping.findForward("manage");
}
if (form.getAction().equals("w")) {
Pages pages = new Pages(httpServletRequest);
pages.setPage(form.getPage());
pages.setPerPageNum(40);
pages.setFileName("manage" + Constant.FILEPREFIX + "?action=w&bid=" +
form.getBid());
pages.setStyle(1);
PageList pl = getForumService().findForumDelAllList(form.getBid(), pages);
//PageList pl = getForumService().getForumAllList(form.getBid(), (short) 1,(short) 0, pages);
PostsForm postsForm = new PostsForm();
postsForm.setBid(form.getBid());
postsForm.setPage(form.getPage());
postsForm.setAction("delws");
httpServletRequest.setAttribute("bid", String.valueOf(form.getBid()));
httpServletRequest.setAttribute("pl", pl);
httpServletRequest.setAttribute("uc", uc);
httpServletRequest.setAttribute("pages", String.valueOf(form.getPage()));
httpServletRequest.setAttribute("postsForm", postsForm);
return actionMapping.findForward("manage");
}
return actionMapping.findForward("error");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -