<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
server.ScriptTimeout =3600
On Error Resume Next
If session("admau")="" Then
	ec="授权非法，有可能是超时造成的。"
Response.Redirect "e.asp?e="&ec
End If
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")


response.write "执行中.....<br>"
	Set dsph = Server.CreateObject("ADODB.Recordset")
Sql="Select * from FreeHost.FreeHost_Product_Host where  alldomainok=0"
	dsph.Open Sql,conn,1,3
while not dsph.Eof
alldomainok=1
hostname=dsph("hostname")
hostname=replace(hostname, ":80:","")
hostname_arry=Split(hostname, ",")
for i=0 to ubound(hostname_arry)

domain=hostname_arry(i)

domain=ComX.idntoac_7i24_com(cstr(domain))

if err.number <> 0 then%>
域名处理失败:<%=hostname_arry(i)%>,所属FTP用户名:<%=dsph("ftpname")%>请用管理员重新绑定或删除这个域名,
<%
err.clear
End if

	Set dsICPDB = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ICPDB where domain='"&GetDomainMain(domain)&"'"
	dsICPDB.Open Sql,conn,1,3
if dsICPDB.Eof Then
dsICPDB.addnew
dsICPDB("username")=dsph("username")
dsICPDB("ftpname")=dsph("ftpname")
dsICPDB("domain")=GetDomainMain(domain)
dsICPDB("status")="尚未检测"
dsICPDB("firstaddtime")=Now
dsICPDB("agent1")=dsph("agent1")
dsICPDB("agent2")=dsph("agent2")
dsICPDB.update
alldomainok=0
Else
If dsICPDB("status")<>"备案成功" Then alldomainok=0
end If
dsICPDB.close
Next

If alldomainok=1 Then 
dsph("alldomainok")=1
dsph("beianstatus")="备案成功"
Else
dsph("alldomainok")=0
dsph("beianstatus")=null
End If
dsph.update


dsph.movenext
wend
dsph.close






set dsph=nothing
conn.close
set conn=nothing
%>自动同步备案域名成功完成,旧域名已列入下次检查表中.
