📄 user_modify.jsp
字号:
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="java.util.*" %>
<%@ page import="cn.js.fan.web.*" %>
<%@ page import="com.cloudwebsoft.framework.base.*" %>
<%@ page import="cn.js.fan.util.*" %>
<%@ page import="com.redmoon.forum.person.*" %>
<%@ page import="com.redmoon.forum.*" %>
<%@ page import="com.redmoon.forum.plugin.*" %>
<%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="../common.css" type=text/css rel=stylesheet>
<LINK href="default.css" type=text/css rel=stylesheet>
<title><lt:Label res="res.label.forum.admin.user_m" key="user_manage"/></title>
<SCRIPT language=javascript>
<!--
function form1_onsubmit() {
if (form1.pwd.value!=form1.pwd_confirm.value) {
alert("<lt:Label res="res.label.forum.admin.user_m" key="pwd_not_equal"/>");
return false;
}
}
//-->
</script></head>
<body>
<jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
<jsp:useBean id="us" scope="page" class="com.redmoon.forum.person.userservice"/>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
<jsp:useBean id="prision" scope="page" class="com.redmoon.forum.life.prision.Prision"/>
<%
if (!privilege.isMasterLogin(request))
{
out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
return;
}
String op = StrUtil.getNullString(request.getParameter("op"));
String username = ParamUtil.get(request, "username");
UserDb user = new UserDb();
user = user.getUser(username);
UserPrivDb upd = new UserPrivDb();
upd = upd.getUserPrivDb(username);
if (op.equals("priv")) {
/*
int maxAttachDayCount = ParamUtil.getInt(request, "attach_day_count");
int maxAttachmentSize = ParamUtil.getInt(request, "attach_size");
String add_topic = ParamUtil.get(request, "add_topic");
if (add_topic.equals(""))
add_topic = "0";
String reply_topic = ParamUtil.get(request, "reply_topic");
if (reply_topic.equals(""))
reply_topic = "0";
upd.set("attach_day_count", new Integer(maxAttachDayCount));
upd.set("attach_size", new Integer(maxAttachmentSize));
upd.set("add_topic", add_topic);
upd.set("reply_topic", reply_topic);
if (upd.save())
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
else
out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "info_op_fail")));
*/
QObjectMgr qom = new QObjectMgr();
if (qom.save(request, upd, "sq_user_priv_save"))
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
else
out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "info_op_fail")));
}
if (op.equals("priv_reset")) {
upd.del();
upd.init(username);
upd = upd.getUserPrivDb(username);
}
String privurl = StrUtil.getNullString(request.getParameter("privurl"));
if (op.equals("pwd")) {
String pwd = StrUtil.getNullString(request.getParameter("pwd"));
try {
if (us.ModifyPWD(response,username, pwd, privurl))
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
}
catch (ErrMsgException e) {
out.print(StrUtil.Alert(e.getMessage()));
}
}
if (op.equals("modify")) {
String nick = ParamUtil.get(request, "nick").trim();
if (nick.equals("")) {
out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "res.label.forum.admin.user_m", "need_nick")));
return;
}
String isValid = request.getParameter("isValid");
if (isValid==null)
isValid = "true";
String groupCode = ParamUtil.get(request, "groupCode");
if (isValid.equals("false"))
user.setValid(false);
else
user.setValid(true);
user.setGroupCode(groupCode);
int diskSpaceAllowed = (int)user.getDiskSpaceAllowed();
try {
diskSpaceAllowed = ParamUtil.getInt(request, "diskSpaceAllowed");
}
catch (Exception e) {
}
user.setDiskSpaceAllowed((long)diskSpaceAllowed);
user.setNick(nick);
String strCheckStatus = ParamUtil.get(request, "checkStatus");
if (StrUtil.isNumeric(strCheckStatus)) {
user.setCheckStatus(Integer.parseInt(strCheckStatus));
}
else
user.setCheckStatus(user.CHECK_STATUS_NOT);
if (user.save())
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
else
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
}
if (op.equals("modifyValue")) {
int credit = ParamUtil.getInt(request, "credit");
int experience = ParamUtil.getInt(request, "experience");
int gold = ParamUtil.getInt(request, "gold");
user = user.getUser(username);
user.setCredit(credit);
user.setExperience(experience);
user.setGold(gold);
if (user.save())
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
else
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
}
if (op.equals("delmsg")) {
// user.del();
MsgDb md = new MsgDb();
int count = md.delMessagesOfUser(user.getName());
out.print(StrUtil.Alert(SkinUtil.LoadString(request, "res.label.forum.admin.user_m", "del_count")));
}
if (op.equals("deluser")) {
if (user.del())
out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "user_m.jsp"));
else
out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "info_op_fail")));
}
if (op.equals("arrest")) {
boolean isvalid = true;
String arresttime = ParamUtil.get(request, "arresttime");
String arrestreason = ParamUtil.get(request, "arrestreason");
int arrestday = 0;
String errmsg = "";
try {
arrestday = ParamUtil.getInt(request, "arrestday");
}
catch (ErrMsgException e) {
errmsg += SkinUtil.LoadString(request, "res.label.forum.admin.user_m", "err_day_count") + "\\r\\n";
isvalid = false;
}
if (arresttime.equals("") || arrestreason.equals("")) {
errmsg += SkinUtil.LoadString(request, "res.label.forum.admin.user_m", "err_date_reason") + "\\r\\n";
isvalid = false;
}
if (arrestday<=0) {
errmsg += SkinUtil.LoadString(request, "res.label.forum.admin.user_m", "day_count_big_than_zero") + "\\r\\n";
isvalid = false;
}
if (!errmsg.equals(""))
out.print(StrUtil.Alert(errmsg));
if (isvalid)
{
try {
isvalid = prision.arrest(privilege.getUser(request), username, arresttime, arrestreason, arrestday);
if (isvalid)
out.println(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
else
out.println(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
}
catch (ResKeyException e) {
out.print(StrUtil.Alert(e.getMessage(request)));
}
}
}
if (op.equals("release")) {
try {
boolean isvalid = prision.release(username);
if (isvalid)
out.println(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
else
out.println(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
}
catch (ResKeyException e) {
out.print(StrUtil.Alert(e.getMessage(request)));
}
}
%>
<TABLE
style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid"
cellSpacing=0 cellPadding=3 width="95%" align=center>
<TBODY>
<TR>
<TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%"> <a href="user_m.jsp"><lt:Label res="res.label.forum.admin.user_m" key="back_to_user_list"/></a></TD>
</TR>
<TR class=row style="BACKGROUND-COLOR: #fafafa">
<TD align="center" style="PADDING-LEFT: 10px"><table width="550" border="0" align="center" class="frame_gray">
<form name=form1 action="user_modify.jsp?op=pwd" method="post" onSubmit="return form1_onsubmit()">
<tr>
<td width="12%" height="23"> </td>
<td align="center" colspan="2" height="23"><b><lt:Label res="res.label.forum.admin.user_m" key="modify_pwd"/></b></td>
</tr>
<tr>
<td width="12%"> </td>
<td width="21%" align="left"><lt:Label res="res.label.forum.admin.user_m" key="user_name"/></td>
<td width="67%" align="left"><%=user.getNick()%><input name="username" value="<%=username%>" type=hidden> </td>
</tr>
<tr>
<td width="12%"> </td>
<td width="21%" align="left"><lt:Label res="res.label.forum.admin.user_m" key="pwd"/></td>
<td width="67%" align="left"><input name=pwd type=password class="singleboarder"> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -