📄 admin_user.asp
字号:
End Sub
Sub saveAddUser()
if getPopedom("userAdmin")=false then
popedomMsg
exit sub
end if
dim userName,userPass1,userPass2,question,answer,sex,trueName,face,qq,email,homePage,telNumber,address,code,info,maosinPoint,maosinMoney,maosinLevel,maosinStatus
userName=trim(Request.Form("userName"))
userPass1=trim(Request.Form("userPass1"))
userPass2=trim(Request.Form("userPass2"))
question=trim(Request.Form("question"))
answer=trim(Request.Form("answer"))
sex=trim(Request.Form("sex"))
trueName=trim(Request.Form("trueName"))
face=trim(Request.Form("maosinFace"))
qq=trim(Request.Form("qq"))
email=trim(Request.Form("email"))
homePage=trim(Request.Form("homePage"))
telNumber=trim(Request.Form("telNumber"))
address=trim(Request.Form("address"))
code=trim(Request.Form("maosinCode"))
info=trim(Request.Form("maosinInfo"))
maosinPoint=trim(Request.Form("maosinPoint"))
maosinMoney=trim(Request.Form("maosinMoney"))
maosinLevel=trim(Request.Form("maosinLevel"))
maosinStatus=trim(Request.Form("maosinStatus"))
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂盛系统返回如下信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
if userName="" then
adminShowMsg "出错信息","用户名不能为空"
exit sub
elseif strLength(userName)<3 or len(userName)>12 then
adminShowMsg "出错信息","用户名不能小于 <font color=""#ff0000"">3</font> 个字符或者大于 <font color=""#ff0000"">12</font> 个字符"
exit sub
end if
dim errormsg
if chkIsAvaStr(userName)=false then
adminShowMsg "出错信息","用户名含有非法字符"
exit sub
end if
if conn.execute("select count(user_id) from ms_user where user_name='"&lcase(chkFormStr(username))&"'")(0)<>0 then
adminShowMsg "用户名无效","很抱歉,<font color=""#ff0000"">"&username&"</font> 用户名已有人使用了,请换其它试试看"
exit sub
end if
if userPass1=""then
errormsg=errormsg&"<li>密码不能为空</li>"
elseif strLength(userPass1)>20 then
errormsg=errormsg&"<li>密码长度最长不能大于 <font color=""#ff0000"">20</font> 个字符</li>"
elseif userPass1<>userPass2 then
errormsg=errormsg&"<li>两次输入的密码不正确!</li>"
end if
if strLength(question)>40 then
errormsg=errormsg&"<li>密码问题最多不能大于 <font color=""#ff0000"">40</font> 个字符</li>"
end if
if strLength(answer)>20 then
errormsg=errormsg&"<li>问题答案最多不能大于 <font color=""#ff0000"">20</font> 个字符</li>"
end if
if qq<>"" then
if isInteger(qq)=false then
errormsg=errormsg&"<li>填写的QQ号不正确</li>"
elseif (len(qq)<5 or len(qq)>10) then
errormsg=errormsg&"<li>填写的QQ号位数不正确</li>"
end if
end if
if email<>"" then
if IsValidEmail(email)=false then
errormsg=errormsg&"<li>电子邮件填写不正确</li>"
elseif strLength(email)>50 then
errormsg=errormsg&"<li>电子邮件地址最多不能大于 <font color=""#ff0000"">50</font> 个字符</li>"
end if
end if
if maosinPoint<>"" then
if isInteger(maosinPoint)=false then
errormsg=errormsg&"<li>用户点数应为整型数字</li>"
else
maosinPoint=cint(maosinPoint)
end if
else
maosinPoint=0
end if
if maosinMoney<>"" then
if isInteger(maosinMoney)=false then
errormsg=errormsg&"<li>用户货币应为整型数字</li>"
else
maosinMoney=cint(maosinMoney)
end if
else
maosinMoney=0
end if
if strLength(homePage)>100 then
errormsg=errormsg&"<li>主页地址最多不能大于 <font color=""#ff0000"">50</font> 个字符</li>"
end if
if strLength(trimName)>20 then
errormsg=errormsg&"<li>真实姓名最多不能大于 <font color=""#ff0000"">20</font> 个字符</li>"
end if
if strLength(address)>50 then
errormsg=errormsg&"<li>联系地址最多不能大于 <font color=""#ff0000"">50</font> 个字符</li>"
end if
if strLength(telNumber)>15 then
errormsg=errormsg&"<li>电话号码最多不能大于 <font color=""#ff0000"">15</font> 个字符</li>"
end if
if strLength(code)>6 then
errormsg=errormsg&"<li>邮政编码最多不能大于 <font color=""#ff0000"">6</font> 个字符</li>"
end if
if strLength(info)>200 then
errormsg=errormsg&"<li>个性签名最多不能大于 <font color=""#ff0000"">6</font> 个字符</li>"
end if
if errormsg<>"" then
adminShowMsg "出错信息",errormsg
exit sub
end if
userName=chkFormStr(userName)
userPass1=chkFormStr(userPass1)
question=chkFormStr(question)
answer=chkFormStr(answer)
face=chkFormStr(face)
sex=chkFormStr(sex)
qq=chkFormStr(qq)
face=chkFormStr(face)
if face="" then
face="1"
end if
trueName=chkFormStr(trueName)
telNumber=chkFormStr(telNumber)
address=chkFormStr(address)
email=chkFormStr(email)
homePage=chkFormStr(homePage)
code=chkFormStr(code)
info=chkFormStr(info)
dim sql
sql="insert into ms_user(user_name,user_password,user_question,user_answer,sex,email,homepage,qq,linkman,face,address,postalcode,tel,user_type,reg_date,last_ip,logon_num,islock,info,user_money,user_point) "
sql=sql&"values('"&Lcase(userName)&"','"&md5(userPass1)&"','"&question&"','"&md5(answer)&"','"&sex&"','"&email&"','"&homePage&"','"&qq&"','"
sql=sql&trueName&"',"&face&",'"&address&"','"&code&"','"&telNumber&"',"&maosinLevel&",#"&Now()&"#,'"&getIp()&"',0,"&maosinStatus&",'"&info&"',"&maosinMoney&","&maosinPoint&")"
conn.execute(sql)
adminShowMsg "成功信息","恭喜恭喜,新用户 <font color=""#ff0000"">"&userName&"</font> 添加成功"
End Sub
Sub saveModifyUser()
if getPopedom("userAdmin")=false then
popedomMsg
exit sub
end if
dim userID,userName,userPass1,userPass2,question,answer,sex,trueName,face,qq,email,homePage,telNumber,address,code,info,maosinPoint,maosinMoney,maosinLevel,maosinStatus
userID=trim(Request.Form("userID"))
userPass1=trim(Request.Form("userPass1"))
userPass2=trim(Request.Form("userPass2"))
question=trim(Request.Form("question"))
answer=trim(Request.Form("answer"))
sex=trim(Request.Form("sex"))
trueName=trim(Request.Form("trueName"))
face=trim(Request.Form("maosinFace"))
qq=trim(Request.Form("qq"))
email=trim(Request.Form("email"))
homePage=trim(Request.Form("homePage"))
telNumber=trim(Request.Form("telNumber"))
address=trim(Request.Form("address"))
code=trim(Request.Form("maosinCode"))
info=trim(Request.Form("maosinInfo"))
maosinPoint=trim(Request.Form("maosinPoint"))
maosinMoney=trim(Request.Form("maosinMoney"))
maosinLevel=trim(Request.Form("maosinLevel"))
maosinStatus=trim(Request.Form("maosinStatus"))
logonNum=trim(Request.Form("logonNum"))
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂盛系统返回如下信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
if isInteger(userID)=false then
adminShowMsg "参数出错","用户ID参数应为一个数字整型参数"
exit sub
end if
dim errormsg
if strLength(userPass1)>20 then
errormsg=errormsg&"<li>密码长度最长不能大于 <font color=""#ff0000"">20</font> 个字符</li>"
elseif userPass1<>userPass2 then
errormsg=errormsg&"<li>两次输入的密码不正确!</li>"
end if
if strLength(question)>40 then
errormsg=errormsg&"<li>密码问题最多不能大于 <font color=""#ff0000"">40</font> 个字符</li>"
end if
if strLength(answer)>20 then
errormsg=errormsg&"<li>问题答案最多不能大于 <font color=""#ff0000"">20</font> 个字符</li>"
end if
if qq<>"" then
if isInteger(qq)=false then
errormsg=errormsg&"<li>填写的QQ号不正确</li>"
elseif (len(qq)<5 or len(qq)>10) then
errormsg=errormsg&"<li>填写的QQ号位数不正确</li>"
end if
end if
if email<>"" then
if IsValidEmail(email)=false then
errormsg=errormsg&"<li>电子邮件填写不正确</li>"
elseif strLength(email)>50 then
errormsg=errormsg&"<li>电子邮件地址最多不能大于 <font color=""#ff0000"">50</font> 个字符</li>"
end if
end if
if maosinPoint<>"" then
if isInteger(maosinPoint)=false then
errormsg=errormsg&"<li>用户点数应为整型数字</li>"
else
maosinPoint=cint(maosinPoint)
end if
else
maosinPoint=0
end if
if maosinMoney<>"" then
if isInteger(maosinMoney)=false then
errormsg=er
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -