<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If Request("username")="" or RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="会员名没有写/或会员名中有非法字符！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent where username='"&Request("username")&"'"
		ds.Open Sql,conn,1,3
if ds.eof then
	ef=True
	ec="用户不存在!"
end if
end if

if not ef then
if Request("key")<>md5(ds("password")) then
		ef=True
		ec="原密码不正确！"
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>　重设密码
<%=htmlwrite("html6")%>
<br>
<br>
<%If Request("op")="true" Then
newpass=Left(md5(now),12)
ds("password")=md5(newpass)
ds.update
%>
密码已自动重设为：<%=newpass%><br>
<%else%>
<a href="resetpass.asp?username=<%=Request("username")%>&key=<%=Request("key")%>&op=true">请您点击这儿生成随机密码>>></a>
<%End if%>
<%=htmlwrite("html7")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
