📄 manageh.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: Manageh.java
package com.laoer.bbscs.web.action;
import com.laoer.bbscs.bean.*;
import com.laoer.bbscs.business.*;
import com.laoer.bbscs.business.service.BoardList;
import com.laoer.bbscs.sys.Constant;
import com.laoer.bbscs.sys.SysUtil;
import com.laoer.bbscs.web.form.ManageForm;
import com.laoer.bbscs.web.servlet.UserCheck;
import com.laoer.comm.util.Util;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;
// Referenced classes of package com.laoer.bbscs.web.action:
// BaseAction
public class Manageh extends BaseAction
{
public Manageh()
{
}
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
{
ActionErrors errors = new ActionErrors();
ManageForm form = (ManageForm)actionForm;
UserCheck uc = getUserCheck(httpServletRequest, httpServletResponse, form.getBid());
if(uc.isGuest())
{
errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
saveErrors(httpServletRequest, errors);
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("list"))
{
java.util.List bulist = getBlackUserService().findBlackUserList((short)0, 0L, form.getBid());
httpServletRequest.setAttribute("bulist", bulist);
form.setYear(Util.getYear());
form.setMonth(Util.getMonth());
form.setDay(Util.getDay());
httpServletRequest.setAttribute("manageForm", form);
form.setBulletin(uc.getBs().getBulletin());
form.setAction("bull");
httpServletRequest.setAttribute("boardsForm", form);
httpServletRequest.setAttribute("caninuser", Util.notNull(uc.getBs().getUserCanIn()));
httpServletRequest.setAttribute("bid", String.valueOf(form.getBid()));
return actionMapping.findForward("manageh");
}
if(form.getAction().equals("add"))
{
UserInfo buuser = getUserInfoService().findUserInfoByUserName(form.getBlackUserName());
if(buuser == null)
{
errors.add("error.user.nouser", new ActionError("error.user.nouser"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
if(getBlackUserService().findBlackUserByUserName(form.getBlackUserName(), (short)0, 0L, form.getBid()) != null)
{
errors.add("error.blackuser.exist", new ActionError("error.blackuser.exist"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
BlackUser bu = new BlackUser();
bu.setAddName(uc.getUsername());
bu.setAtBoard(0L);
bu.setAtBoards(form.getBid());
bu.setAtSite((short)0);
bu.setOutTime(Util.Date2Long(form.getYear(), form.getMonth(), form.getDay()));
bu.setReason(form.getReason());
bu.setUserID(buuser.getId().longValue());
bu.setUserName(form.getBlackUserName());
bu = getBlackUserService().saveBlackUser(bu);
if(bu == null)
{
errors.add("error.blackuser.add", new ActionError("error.blackuser.add"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
} else
{
ActionForward f = new ActionForward("/manageh" + Constant.FILEPREFIX + "?action=list&bid=" + form.getBid(), true);
return f;
}
}
if(form.getAction().equals("del"))
{
BlackUser bu = getBlackUserService().findBlackUserByUserName(form.getBlackUserName(), (short)0, 0L, form.getBid());
if(bu != null)
getBlackUserService().removeBlackUser(bu);
ActionForward f = new ActionForward("/manageh" + Constant.FILEPREFIX + "?action=list&bid=" + form.getBid(), true);
return f;
}
if(form.getAction().equals("bull"))
{
if(!uc.isSuperAdmin() && !uc.isBmaster() && !uc.isMainMaster())
{
errors.add("error.purviewerror1", new ActionError("error.purviewerror1"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
Boards bs = uc.getBs();
bs.setBulletin(form.getBulletin());
bs = getBoardsService().saveBoards(bs);
if(bs != null)
getBoardList().getBoardsHm().put(bs.getId(), bs);
ActionForward f = new ActionForward("/manageh" + Constant.FILEPREFIX + "?action=list&bid=" + form.getBid(), true);
return f;
}
if(form.getAction().equals("addcanin"))
{
if(!uc.isSuperAdmin() && !uc.isBmaster() && !uc.isMainMaster())
{
errors.add("error.purviewerror1", new ActionError("error.purviewerror1"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
UserInfo caninuser = getUserInfoService().findUserInfoByUserName(form.getCanInUserName());
if(caninuser == null)
{
errors.add("error.user.nouser", new ActionError("error.user.nouser"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
Boards bs = uc.getBs();
if(("," + Util.notNull(bs.getUserCanIn())).indexOf("," + form.getCanInUserName() + ",") != -1)
{
errors.add("error.reg.name1", new ActionError("error.reg.name1"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
bs.setUserCanIn(bs.getUserCanIn() + form.getCanInUserName() + ",");
bs = getBoardsService().saveBoards(bs);
if(bs != null)
getBoardList().getBoardsHm().put(bs.getId(), bs);
ActionForward f = new ActionForward("/manageh" + Constant.FILEPREFIX + "?action=list&bid=" + form.getBid(), true);
return f;
}
if(form.getAction().equals("delcanin"))
{
if(!uc.isSuperAdmin() && !uc.isBmaster() && !uc.isMainMaster())
{
errors.add("error.purviewerror1", new ActionError("error.purviewerror1"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
Boards bs = uc.getBs();
String caninuser = Util.notNull(bs.getUserCanIn());
if(("," + caninuser).indexOf("," + form.getCanInUserName() + ",") != -1)
caninuser = Util.replace(caninuser, form.getCanInUserName() + ",", "");
bs.setUserCanIn(caninuser);
bs = getBoardsService().saveBoards(bs);
if(bs != null)
getBoardList().getBoardsHm().put(bs.getId(), bs);
ActionForward f = new ActionForward("/manageh" + Constant.FILEPREFIX + "?action=list&bid=" + form.getBid(), true);
return f;
} else
{
return actionMapping.findForward("error");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -