<%
'乘风多用户计数器
'作者QQ：178575
'作者EMail：yliangcf@163.com
'作者网站：http://www.qqcf.com
'详细简介：http://www.qqcf.com/cfcount.htm
'上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
'因为这些内容可能时常更新，没有放在程序里，请自己上网站上查看
%>


<div id=webmain>

<div class="f-l w-960">
<H2><span class=s-1>找回密码</span>
<div class=bdr-right></div>
</H2>
<div class=bdr>


<%If Action="pwdget" And CInt(Request("Assort"))=1 Then%>
<%
UserName=GoBack(ChkStr(request("UserName"),1),"请输入用户名")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from CFCount_User where UserName='"&UserName&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then  Call AlertBack("没有此用户名!",1)
if Rs("PwdAsk")="" Then Call AlertBack("你以前没有填写密码保护资料!",1)
%>
<table>
<form name="form1" method="post" action="?Action=answermodifypwd&UserName=<%=UserName%>">
<tr> 
<td width="40%" class="td_3"> 密码提示问题： 
</td>
<td><%=rs("pwdask")%></td>
</tr>
<tr> 
<td class="td_3">密码提示答案： </td>
<td><input name="pwdanswer" type="text" size="20"></td>
</tr>
<tr> 
<td></td>
<td>
<input type="submit" name="Submit3" value="确定">
</td>
</tr>
</form>
</table>
<%End if%>


<%If Action="pwdget" And CInt(Request("Assort"))=2 Then%>  
<%
UserName=GoBack(ChkStr(request("UserName"),1),"请输入用户名")

MakeTime = DateDiff("s", "1970-1-1", Now())

If (RsSet("CodeHeadType") = 1) Then
	Tmp = "//" & Mid(HttpPath(2), InStr(HttpPath(2), "//") + 2)
ElseIf (RsSet("CodeHeadType") = 2) Then
	Tmp = "https://" & Mid(HttpPath(2), InStr(HttpPath(2), "//") + 2)
ElseIf (RsSet("CodeHeadType") = 3) Then
	Tmp = RsSet("CodeHeadSelf")
End If

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from CFCount_User where UserName='"&UserName&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then  Call AlertBack("没有此用户名!",1)

EmailTo=Rs("email")
EmailFrom=RsSet("SmtpUser")
EmailFromName=RsSet("SysTitle")
EmailSubj="找回密码的链接"
EmailBody=RsSet("SysTitle")&"发送的修改计数器的密码的链接,发送时间"&Now()&"<br>打开下面链接修改你的计数器密码<br>"
EmailUrl = Tmp&"PwdRecover.asp?Action=pwdmodify&username="&UserName& "&maketime=" & MakeTime & "&checkcode=" & Md5(UserName & MakeTime & Rs("Pwd"), 2)
EmailBody=EmailBody & "<a href='"&EmailUrl&"' target='_blank'>"&EmailUrl&"</a>"




If RsSet("emailsendtype")=1 Then
    err.clear
	Set objEmail = Server.CreateObject("Persits.MailSender")
	objEmail.Host = RsSet("SmtpAddress")
	objEmail.Username = EmailFrom	
	objEmail.Password = RsSet("SmtpPassword")
	objEmail.From = EmailFrom
	objEmail.FromName = EmailFromName
	objEmail.AddAddress(EmailTo)
	objEmail.Subject = EmailSubj
	objEmail.IsHTML = True
	objEmail.CharSet = "gb2312"
	objEmail.Body = EmailBody
	
	if RsSet("EmailSendPort")=465 Then
		objEmail.SSL = True
		objEmail.Port = 465
	elseif RsSet("EmailSendPort")=587 Then
		objEmail.TLS = True
		objEmail.Port = 587
	End If

	objEmail.Send
	
	if err then
		response.write(err.description)
		response.end
	end if
End if
%>

<table class="tb_3">
              <tr class="tr_1"> 
                <td class="td_2">密码已经成功发送到你的<font color="#33CC00"><font color="#ff0000"><%=rs("email")%></font></font>,请查收,如果没有收到邮件请联系计数器系统管理员解决！</td></tr> 
              <tr> 
                <td class="td_2"><input type="submit" name="Submit" value="返回首页" onclick="location.href='<%=HttpPath(5)%>'"></tr> 
</table>
<%end if%>


<div class=clear></div>
</div>
<div class="bdr-bottom-960">
<div class=bdr-right2></div>
</div>
<div class="bk-10"></div>
</div>

</div>