Sub APIEnable(U,P)
'API整合接口
If API_Enable Then
Dim API
Set API = New API_WRMPS
API.LoadXmlFile True
API.UserName=U
API.PassWord=P
Call API.ProcessMultiPing("update")
Set API=Nothing
End If
End Sub
Call DBConnBegin()
Dim UserName,Code,Question,Answer,NewPass,PassWord,Pass
Select Case Request("Action")
Case "PassFour"
Call WRMPS.CheckSubmit()
If Int(WRMPS.GetCookies("GetPass")) > Int(WR_User(2)) Then Call WRMPS.ErrView("·您取回密码次数已超出系统限制,请24小时后再试。",0)
UserName = WRMPS.CheckStr(Request.Form("UserName"),0)
PassWord = WRMPS.CheckStr(Request.Form("PassWord"),0)
Pass = WRMPS.CheckStr(Request.Form("Pass"),0)
Code = WRMPS.CheckStr(Request.form("Code"),0)
Question = WRMPS.CheckStr(Request.form("Question"),0)
Answer = WRMPS.CheckStr(Request.form("Answer"),0)
If UserName = "" Then
If Int(WR_User(2)) > 0 Then WRMPS.SCookies "GetPass",WRMPS.GetCookies("GetPass")+1,1
Call WRMPS.ErrView("·操作错误",0)
End If
If PassWord = "" Or Len(PassWord) < Int(Split(WR_User(4),"|")(0)) Or Len(PassWord) > Int(Split(WR_User(4),"|")(1)) Then Call WRMPS.ErrView("·用户密码不正确",0)
If Pass PassWord Then Call WRMPS.ErrView("·确认密码不正确",0)
If WRMPS.CheckCode("GetPass",1) Then If Code WRMPS.GetCookies("Code") Then Call WRMPS.ErrView("·验证码不正确",0)
WRMPS.DelCookies "Code"
If Question = "" Then Call WRMPS.ErrView("·操作错误",0)
If Answer = "" Then Call WRMPS.ErrView("·操作错误",0)
Set Rs = Conn.Execute("Select WM_UserName From WM_Member Where WM_UserName = '"&UserName&"' and WM_Question = '"&Question&"' and WM_Answer = '"&MD5(2,Answer)&"'")
If Not Rs.Eof Then
Call APIEnable(UserName,PassWord)
Conn.Execute("Update WM_Member Set WM_PassWord='"&MD5(2,PassWord)&"' Where WM_UserName = '"&UserName&"'")
WRMPS.SCookies "GetPass",0,0
Call WRMPS.ErrView("·密码修改成功·现在登录?",1)
Else
If Int(WR_User(2)) > 0 Then WRMPS.SCookies "GetPass",WRMPS.GetCookies("GetPass")+1,1
Call WRMPS.ErrView("·操作错误",0)
End If
Rs.Close
Set Rs = Nothing
Case "PassThree"
Call WRMPS.CheckSubmit()
If Int(WRMPS.GetCookies("GetPass")) > Int(WR_User(2)) Then Call WRMPS.ErrView("·您取回密码次数已超出系统限制,请24小时后再试。",0)
UserName = WRMPS.CheckStr(Request.Form("UserName"),0)
Question = WRMPS.CheckStr(Request.form("Question"),0)
Answer = WRMPS.CheckStr(Request.form("Answer"),0)
Code = WRMPS.CheckStr(Request.form("Code"),0)
If UserName = "" Then
If Int(WR_User(2)) > 0 Then WRMPS.SCookies "GetPass",WRMPS.GetCookies("GetPass")+1,1
Call WRMPS.ErrView("·操作错误",0)
End If
If Question = "" Then Call WRMPS.ErrView("·请输入密码提示问题",0)
If Answer = "" Then Call WRMPS.ErrView("·请输入密码提示密码",0)
If WRMPS.CheckCode("GetPass",1) Then If Code WRMPS.GetCookies("Code") Then Call WRMPS.ErrView("·验证码不正确",0)
WRMPS.DelCookies "Code"
Set Rs = Conn.Execute("Select WM_Answer,WM_Email From WM_Member Where WM_UserName = '"&UserName&"' and WM_Question = '"&Question&"'")
If Not Rs.Eof Then
If Rs(0) MD5(2,Answer) Then
If Int(WR_User(2)) > 0 Then WRMPS.SCookies "GetPass",WRMPS.GetCookies("GetPass")+1,1
Call WRMPS.ErrView("·用户问题提示密码不正确,请重新输入",0)
End If
If Int(WR_User(6)) > 0 And WR_Mail(5) "NO" Then '邮件发密码
Randomize Timer
NewPass = Left(Md5(0,Cint(8999*Rnd+1000)),10)
MailBody = WR_Mail(7)&vbCrLf&vbCrLf&WR_Mail(4)
MailBody = Replace(MailBody,"{$User}",UserName)
MailBody = Replace(MailBody,"{$Pass}",NewPass)
Subject = WR_Setting(0)&"会员密码修改成功!"
If WRMPS.SendMail(WRTemp.SiteLabel(MailBody),WR_Setting(0),Subject,Rs(1)) = True Then
Call APIEnable(UserName,NewPass)
Conn.Execute("Update WM_Member Set WM_PassWord='"&MD5(2,NewPass)&"' Where WM_UserName = '"&UserName&"'")
WRMPS.SCookies "GetPass",0,0
Call WRMPS.ErrView("·新密码已经发送到您的邮箱,请注意查收·现在登录?",1)
End If
End If
SitePath = ",找回密码第三步"
SitePath = WRMPS.GetSitePath(0,SitePath)
Call WRMPS.FsoBegin()
TempStr = WRTemp.SiteTemplates(1,0,9,0)
Call WRMPS.FsoEnd()
If Instr(TempStr,"{$IDCode}") > 0 Then
TempStr = WRMPS.GetReplace(TempStr,"{$IsIDCode}",WRMPS.CheckCode("GetPass",1))
If WRMPS.CheckCode("GetPass",1) Then
TempStr = WRMPS.GetReplace(TempStr,"{$IDCode}","")
Else
TempStr = WRMPS.GetReplace(TempStr,"{$IDCode}"," style=""display:none""")
End If
End If
TempStr = WRMPS.GetReplace(TempStr,"{$User}",UserName)
TempStr = WRMPS.GetReplace(TempStr,"{$Question}",Question)
TempStr = WRMPS.GetReplace(TempStr,"{$Answer}",Answer)
TempStr = WRTemp.SiteLabel(TempStr)
Call ClassEnd()
Else
If Int(WR_User(2)) > 0 Then WRMPS.SCookies "GetPass",WRMPS.GetCookies("GetPass")+1,1
Call WRMPS.ErrView("·操作错误",0)
End If
Rs.Close
Set Rs = Nothing
Response.write TempStr
Case "PassTwo"
Call WRMPS.CheckSubmit()
If Int(WRMPS.GetCookies("GetPass")) > Int(WR_User(2)) Then Call WRMPS.ErrView("·您取回密码次数已超出系统限制,请24小时后再试。",0)
UserName = WRMPS.CheckStr(Request.Form("UserName"),0)
Email = WRMPS.CheckStr(Request.Form("Email"),0)
Code = WRMPS.CheckStr(Request.form("Code"),0)
If UserName = "" Then Call WRMPS.ErrView("·请输入登录用户名",0)
If Email = "" Then Call WRMPS.ErrView("·请输入用户邮箱",0)
If WRMPS.CheckCode("GetPass",1) Then If Code WRMPS.GetCookies("Code") Then Call WRMPS.ErrView("·验证码不正确",0)
WRMPS.DelCookies "Code"
Set Rs = Conn.Execute("Select WM_Question From WM_Member Where WM_UserName = '"&UserName&"' And WM_Email = '"&Email&"'")
If Not Rs.Eof Then
If Rs(0) = "" Then Call WRMPS.ErrView("·您没有设置密码提示问题及答案,不能使用此功能",0)
SitePath = ",找回密码第二步"
SitePath = WRMPS.GetSitePath(0,SitePath)
Call WRMPS.FsoBegin()
TempStr = WRTemp.SiteTemplates(1,0,8,0)
Call WRMPS.FsoEnd()
If Instr(TempStr,"{$IDCode}") > 0 Then
TempStr = WRMPS.GetReplace(TempStr,"{$IsIDCode}",WRMPS.CheckCode("GetPass",1))
If WRMPS.CheckCode("GetPass",1) Then
TempStr = WRMPS.GetReplace(TempStr,"{$IDCode}","")
Else
TempStr = WRMPS.GetReplace(TempStr,"{$IDCode}"," style=""display:none""")
End If
End If
Question = Rs(0)
If Question = "" Or IsNull(Question) Then Call WRMPS.ErrView("·对不起,您没有设置密码问题及答案·请联系管理员获取会员密码!",0)
TempStr = WRMPS.GetReplace(TempStr,"{$User}",UserName)
TempStr = WRMPS.GetReplace(TempStr,"{$Question}",Rs(0))
TempStr = WRTemp.SiteLabel(TempStr)
Call ClassEnd()
Else
Call WRMPS.ErrView("·用户不存在或邮箱填写不正确,请重新输入",0)
End If
Rs.Close
Set Rs = Nothing
Response.write TempStr
Case Else
If IsEmpty(WRMPS.GetCookies("GetPass")) Then WRMPS.SCookies "GetPass",0,1
If Int(WRMPS.GetCookies("GetPass")) > Int(WR_User(2)) Then Call WRMPS.ErrView("·您取回密码次数已超出系统限制,请24小时后再试。",0)
SitePath = ",找回密码第一步"
SitePath = WRMPS.GetSitePath(0,SitePath)
Call WRMPS.FsoBegin()
TempStr = WRTemp.SiteTemplates(1,0,7,0)
Call WRMPS.FsoEnd()
If Instr(TempStr,"{$IDCode}") > 0 Then
TempStr = WRMPS.GetReplace(TempStr,"{$IsIDCode}",WRMPS.CheckCode("GetPass",1))
If WRMPS.CheckCode("GetPass",1) Then
TempStr = WRMPS.GetReplace(TempStr,"{$IDCode}","")
Else
TempStr = WRMPS.GetReplace(TempStr,"{$IDCode}"," style=""display:none""")
End If
End If
TempStr = WRTemp.SiteLabel(TempStr)
Call ClassEnd()
Response.write TempStr
End Select
Call DBConnEnd()
%>