<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%server.ScriptTimeout =7200
'http://主控域名/adm/autodelagenticp.asp?autodel=yes
'自动删除没备案的代理的域名

If session("admau")="" Then
	ec="授权非法，有可能是超时造成的。"
Response.Redirect "e.asp?e="&ec
End If

'On Error Resume Next
response.write "执行中.....<br>"
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")

Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsagentdomain = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_ALLdomain where status is null order by domain asc"
		dsagentdomain.Open Sql,conn,1,3
while not dsagentdomain.eof

'先查工信部数据库
Dim status
status="尚未检测"

if CheckDomainDB(dsagentdomain("domain"))=true Then
'if CheckDomainDB("www.huaerhui.net")=true then
end If

If status="未提交备案" then

response.write "<font color=red>代理名:"&dsagentdomain("username")&" 域名:"&dsagentdomain("domain")&" 状态:"&status&"</font><br>"
If Request("autodel")="yes" then
response.write "<font color=red>"&dsagentdomain("domain")&"已在代理域名表中删除</font><br>"
dsagentdomain.delete
dsagentdomain.update


Else

If status="备案成功" then
response.write "代理名: "&dsagentdomain("username")&" 域名:"&dsagentdomain("domain")&" 状态:"&status&"<br>"
dsagentdomain("status")="备案成功"
dsagentdomain.update
Else
response.write "代理名: "&dsagentdomain("username")&" 域名:"&dsagentdomain("domain")&" 状态:"&status&"　未处理，请刷新<br>"
End if

End if
End if

response.flush()

dsagentdomain.movenext
wend
dsagentdomain.close
set dsagentdomain=nothing
conn.close
set conn=nothing
%>执行完成.