📄 adminuserinfo.java
字号:
package com.laoer.bbscs.web.action;
import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.business.*;
import com.laoer.bbscs.bean.*;
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 AdminUserInfo
extends AdminBaseAction {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
ActionErrors errors = new ActionErrors();
if (!isLogin(httpServletRequest)) {
errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("adminlogin");
}
AdminUserInfoForm form = (AdminUserInfoForm) actionForm;
IUserInfoService uiService = this.getUserInfoService();
if (form.getAction().equals("find")) {
httpServletRequest.setAttribute("adminUserInfoForm", form);
return actionMapping.findForward("find");
}
if (form.getAction().equals("id")) {
form.setAction("up");
UserInfo ui = uiService.findUserInfoById(new Long(form.getId()));
if (ui == null) {
errors.add("error.user.nouser", new ActionError("error.user.nouser"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("find");
}
form.setBoard(ui.getBoard());
form.setBoardMaster(ui.getBoardMaster());
form.setBulletin(ui.getBulletin());
form.setManager(ui.getManager());
form.setSuperAdmin(ui.getSuperAdmin());
form.setUserAdmin(ui.getUserAdmin());
httpServletRequest.setAttribute("adminUserInfoForm", form);
httpServletRequest.setAttribute("ui", ui);
return actionMapping.findForward("userinfo");
}
if (form.getAction().equals("userName")) {
form.setAction("up");
UserInfo ui = uiService.findUserInfoByUserName(form.getUserName());
if (ui == null) {
errors.add("error.user.nouser", new ActionError("error.user.nouser"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("find");
}
form.setId(ui.getId().longValue());
form.setBoard(ui.getBoard());
form.setBoardMaster(ui.getBoardMaster());
form.setBulletin(ui.getBulletin());
form.setManager(ui.getManager());
form.setSuperAdmin(ui.getSuperAdmin());
form.setUserAdmin(ui.getUserAdmin());
httpServletRequest.setAttribute("adminUserInfoForm", form);
httpServletRequest.setAttribute("ui", ui);
return actionMapping.findForward("userinfo");
}
if (form.getAction().equals("email")) {
form.setAction("up");
UserInfo ui = uiService.findUserInfoByEmail(form.getEmail());
if (ui == null) {
errors.add("error.user.nouser", new ActionError("error.user.nouser"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("find");
}
form.setId(ui.getId().longValue());
form.setBoard(ui.getBoard());
form.setBoardMaster(ui.getBoardMaster());
form.setBulletin(ui.getBulletin());
form.setManager(ui.getManager());
form.setSuperAdmin(ui.getSuperAdmin());
form.setUserAdmin(ui.getUserAdmin());
httpServletRequest.setAttribute("adminUserInfoForm", form);
httpServletRequest.setAttribute("ui", ui);
return actionMapping.findForward("userinfo");
}
if (form.getAction().equals("up")) {
UserInfo ui = uiService.findUserInfoById(new Long(form.getId()));
if (ui == null) {
errors.add("error.user.nouser", new ActionError("error.user.nouser"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("userinfo");
}
ui.setBoard(form.getBoard());
ui.setBoardMaster(form.getBoardMaster());
ui.setBulletin(form.getBulletin());
ui.setManager(form.getManager());
ui.setSuperAdmin(form.getSuperAdmin());
ui.setUserAdmin(form.getUserAdmin());
if (uiService.saveUserInfo(ui) == null) {
errors.add("error.userinfo.up", new ActionError("error.userinfo.up"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("userinfo");
}
this.getUserCache().removeFromCache(ui.getId().longValue());
ActionForward f = new ActionForward(SysUtil.getResultUrl(
"admin.userinfo.up.well", "adminUserInfo" + Constant.FILEPREFIX), true);
return f;
}
return actionMapping.findForward("error");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -