📄 usersetup.asp
字号:
IsQQpic=YxBBs.Fun.GetStr("IsQQpic")
If IsQQpic<>"1" Then IsQQpic="0"
Sign=Left(YxBBs.Fun.HtmlCode(YxBBs.Fun.GetStr("Sign")),255)
PicH=YxBBs.Fun.GetStr("PicH")
PicW=YxBBs.Fun.Getstr("PicW")
If YxBBs.BBSSetting(21)=1 And Instr(PicUrl,"://")>0 Then YxBBs.Error("不能使用站外图片作为用户头像!")
If PicUrl="" then
PicUrl="headpic/"& HeadPic &".gif"
PicW= BBSSetting(16)
PicH= BBSSetting(17)
End If
If (QQ<>"" And not isnumeric(QQ)) Or (IsQQpic="1" and QQ="") then YxBBs.Error("请填写有效的QQ号码!")
If Len(Mail)>50 or Len(HeadPic)>220 or Len(QQ)>20 or Len(Home)>250 or Len("Honor")>12 Then YxBBs.Error("您填写的一些字符数超过了论坛的限制!")
If Not isnumeric(PicW) or Not isnumeric(PicH) Then YxBBs.Error("头像宽度和高度必须用数字填写!")
If Int(PicW)>int(YxBBs.BBSSetting(15)) or int(PicH)>int(YxBBs.BBSSetting(15)) then
PicW=YxBBs.BBSSetting(16)
PicH=YxBBs.BBSSetting(17)
End If
If Not isdate(Birthday) then Birthday=""
YxBBs.execute("update [YX_User] set Birthday='"&Birthday&"',Sex="&Sex&",PicW="&PicW&",PicH="&PicH&",Mail='"&Mail&"',QQ='"&QQ&"',Honor='"&Honor&"',Pic='"&PicUrl&"',Home='"&Home&"',Sign='"&Sign&"',IsQQpic="&IsQQpic&" where name='"&YxBBs.MyName&"' And Password='"&YxBBs.MyPwd&"'")
Caption="修 改 成 功"
Content="<div style='margin:15;line-height: 150%'><li>资料修改成功!<li><a href=Profile.Asp>返回我的用户控制面版</a><li><a href=Default.Asp>返回首页</a></div>"
Session(YxBBs.CacheName & "MyInfo") = Empty
Call YxBBs.ShowTable(Caption,Content)
End Sub
Sub MyPassword
Dim Caption,Content
Call YxBBs.Head("修改密码")
Caption="修改密码"
Content="<form style='margin:0' method='POST' action='?action=SaveMyPassword' name='form'>"&_
"<br><table align='center' width='97%' border='0' cellpadding='0' cellspacing='5' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'><tr><td align='left' height='25' bgcolor='#E8E8E8' colspan=3> <img src='Images/inn.gif' align='absmiddle'> <b>修改密码</b></td></tr><tr><td>"&_
"<table width=98% align='center' border=1 rules=rows frame=void style='border-collapse: collapse;'>"&_
"<tr><td width='50%'><b>旧密码确认</b>:<br>请输入旧密码进入确认</td><td><input type='password' name='Password' size='30' maxlength='20'></td></tr><tr><td><b>新的密码(最多14位)</b>:<br>请不要使用任何类似 '*'、' ' 或 HTML 字符</td><td width='50%'><input type='password' name='NewPassword' size='30' maxlength='20'></td></tr><tr><td><b>重复密码</b>:<br>请再输一遍确认</td><td><input type='password' name='RePassword' size='30' maxlength='20'></td></tr>"&_
"<tr><td><b>密码问题</b>:<br>忘记密码的提示问题</td><td><input type='text' name='Clue' size=30 maxlength='60'></td></tr>"&_
"<tr><td><b>问题答案</b>:<br>忘记密码的提示问题答案,用于取回论坛密码</td><td><input type='text' name='Answer' size=30 maxlength='60'></td></tr>"&_
"<tr><td colspan='2' height='30' align='center'><input type='submit' value=' 确 定 '> <input type=reset value=' 取 消 '></td></tr></table></td></tr></table><br></form>"
Call YxBBs.ShowTable(Caption,Content)
End Sub
Sub SaveMyPassword
Dim Rs,Sql,Password,NewPassword,RePassword,Clue,Answer,Caption,Content
YxBBs.Fun.CheckMake'禁止外部提交
Call YxBBs.Head("修改密码")
Password=YxBBs.Fun.GetStr("Password")
NewPassword=YxBBs.Fun.GetStr("NewPassword")
RePassword=YxBBs.Fun.GetStr("RePassword")
Clue=YxBBs.Fun.GetStr("Clue")
Answer=YxBBs.Fun.GetStr("Answer")
If Password="" or Repassword="" or NewPassword="" Then YxBBs.Error("请填写完整的必填项目!")
If Repassword<>NewPassword Then YxBBs.Error("确认新密码与新密码不一致!")
If YxBBs.Fun.StrLength(NewPassword)>14 Then YxBBs.Error("密码长度不能超过14位!")
If md5(Password)<>YxBBs.MyPwd Then YxBBs.Error("旧密码验证错误!")
IF len(NewPassword)<4 Then YxBBs.Error("密码长度不能小于4个字符!")
YxBBs.Execute("update [YX_User] set [password]='"&Md5(Newpassword)&"' where name='"&YxBBs.MyName&"'")
'Set Rs = Server.CreateObject("Adodb.RecordSet")
'Sql="Select Password,Clue,Answer From [YX_User] Where Name='"&YxBBs.MyName&"'"
'Rs.open Sql,Conn,1,3
'If Rs.EOF Then YxBBs.Error(9)
'Rs(0) = Md5(NewPassWord)
'If Clue<>"" Then Rs(1) = Clue
'If Answer<>"" Then Rs(2) = Md5(Answer)
'Rs.Update
'Rs.Close
'Set Rs = Nothing
Response.Cookies(YxBBs.CookiesName)("MyPwd")=Md5(NewPassword)
Caption=" 修 改 成 功"
Content="<div style='margin:15;line-height: 150%'><li>你的密码修改成功!<li><a href=Profile.Asp>返回我的用户控制面版</a><li><a href=Default.Asp>返回首页</a></div>"
Call YxBBs.ShowTable(Caption,Content)
End Sub
Sub ForgetPassword
Dim UserName,Caption,Content
Call YxBBs.Head("找回密码")
Caption="找回密码"
UserName=YxBBs.Fun.GetStr("UserName")
If UserName="" Then
Content="<form style='margin:0' method='POST'>"&_
"<br><table align='center' width='97%' border='0' cellpadding='0' cellspacing='5' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'><tr><td align='left' height='25' bgcolor='#E8E8E8' colspan=3> <img src='Images/inn.gif' align='absmiddle'> 找回密码</td></tr><tr><td>"&_
"<table width=98% align='center' border=1 cellpadding='5' cellspacing='0' rules=rows frame=void>"&_
"<tr><td width='50%'><b>您的用户名:</b><br>请输入注册的用户名称进入确认</td><td><input type='text' name='UserName' size='30' maxlength='20'></td></tr>"&_
"<tr><td colspan='2' height='30' align='center'><input type='submit' value='确定!'> <input type=reset value='重置!'></td></tr></table></td></tr></table><br></form>"
Else
YxBBs.Fun.CheckMake
If Not YxBBs.Fun.CheckName(UserName) Then YxBBs.Error("用户名中包含非法字符!")
If YxBBs.Execute("select name from [YX_User] where name='"&UserName&"'").Eof Then YxBBs.Error("用户名称不存在!")
If Not YxBBs.execute("select name from [YX_User] where name='"&UserName&"' and ClassID<=3").Eof Then YxBBs.Error("版主等级以上用户找会密码请联系管理员!")
Content="<form style='margin:0' method='POST' action='?Action=GetPassword'>"&_
"<br><table align='center' width='97%' border='0' cellpadding='5' cellspacing='1' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'><tr><td height='25' bgcolor='#E8E8E8' colspan=3> <img src='Images/inn.gif' align='absmiddle'> <b>找回密码</b></td></tr><tr><td>"&_
"<table width=98% align='center' border=1 cellpadding='5' cellspacing='1' rules=rows frame=void style='border-collapse: collapse;'>"&_
"<tr><td width='50%'><b>用户名称:</b></td><td><input name='UserName' type='hidden' value='"&UserName&"'><b>"& UserName &"</b></td></tr><tr><td><b>密码问题:</b><br>请输入您在注册时填写的提示问题</td><td width='50%'><input type='text' name='Clue' size='30' maxlength='20'></td></tr><tr><td><b>问题答案:</b><br>请输入您在注册时填写的问题答案</td><td><input type='text' name='Answer' size='30' maxlength='20'></td></tr>"&_
"<tr><td colspan='2' height='30' align='center'><input type='submit' value='确定!'> <input type=reset value='重置!'></td></tr></table></td></tr></table><br></form>"
End If
Call YxBBs.ShowTable(Caption,Content)
End Sub
Sub GetPassword
Dim UserName,Clue,Answer,Caption,NewPassword,Content
YxBBs.Fun.CheckMake
Call YxBBs.Head("找回密码")
If YxBBs.GetCookiesInfo("Forge",0)>2 Then YxBBs.Error("您已经连续输入三次错误!不能再继续找回密码!请联系论坛管理员!")
UserName=YxBBs.Fun.GetStr("UserName")
Clue=YxBBs.Fun.GetStr("Clue")
Answer=YxBBs.Fun.GetStr("Answer")
If UserName="" or Clue="" or Answer="" Then YxBBs.Error("请填写完整的必填项目!")
If Not YxBBs.Fun.CheckName(UserName) Then YxBBs.Error("用户名中包含非法字符!")
If YxBBs.execute("select name from [YX_User] where name='"&UserName&"'").Eof Then YxBBs.Error("用户名称不存在!")
IF YxBBs.execute("select name from [YX_User] where name='"&UserName&"' And Answer='"&Md5(Answer)&"' And Clue='"&Clue&"'").Eof Then
YxBBs.Error("您的密码提示问题和问题答案不正确!<li>输入错误 <font color=red>"&YxBBs.UpdateCookiesInfo("Forge",1)&"</font> 次")
Else
Randomize
NewPassword=int(90000*rnd)+10000
YxBBs.execute("update [YX_user] set [password]='"&Md5(NewPassword)&"' where name='"&UserName&"'")
YxBBs.execute("update [YX_admin] set [password]='"&Md5(NewPassword)&"' where name='"&UserName&"'")
Caption="成功通过验证"
Content="<div style='margin:15;line-height: 150%'><li>您成功的通过密码保护的检验!<li>用户名称:<font color=red>"&UserName&"</font> 获得新密码:<font color=red>"&NewPassword&"</font><li>先记住新密码,请您马上登陆论坛,尽快修改密码!</div>"
Call YxBBs.ShowTable(Caption,Content)
Response.Write YxBBs.Template.ReadTemplate("用户登陆")
End If
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -