<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("username")="" or RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="用户名没填或有非法符号！"
ElseIf Request.Form ("password")="" 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_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and username='"&Request.Form ("username")&"'"
				if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		ds.Open Sql,conn,1,3
if ds.Eof then
	ef=True
	ec="您代理的用户中不存在这个用户！"
end if

if not ef then
ds("password")=md5(request.Form ("password"))
ds.Update

ds.Close
set ds=nothing
conn.Close 
set conn=nothing%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>　　修改用户密码
<%=htmlwrite("html6")%>
<br><br><br><%="用户："&Request.Form ("username")&" 密码已更改成功。"%>
<%=htmlwrite("html7")%>
<%end if

end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
