<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<% 
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("id")="" Then
	ef=True
	ec="请选择产品！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
elseIf session("canadmdomain")="" Then
	ef=True
	ec="您没有此操作的权限。"
elseIf session("candomainpay")="" Then
	ef=True
	ec="您没有此操作的权限。"
elseIf session("candomaindel")="" Then
	ef=True
	ec="您没有此操作的权限。"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
Set dsdom = Server.CreateObject("ADODB.Recordset")
sql="Select * from FreeHost.FreeHost_Product_Domain where id='"&Request.QueryString ("id")&"'"
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsdom.Open sql,conn,1,3
if dsdom.eof then
	ef=True
	ec="不存在的域名！"
end if
end if

if not ef then
'if dsdom("status")="正常" then

if dsdom("DNS_API")=1 then


'删除url
		Sql="delete from FreeHost.FreeHost_Product_URLRE where PdDID='"&dsdom("id")&"'"
  conn.Execute Sql


 	Set dsALLDNS = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLDNS where PdDID='"&dsdom("id")&"'"
	dsALLDNS.Open Sql,conn,1,3
count=dsALLDNS.recordcount
'del zone
if count>0 then
Set dnsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerDNSlist"
	dnsserver.Open Sql,conn,1,1
outcon="DNS域操作："
while not dnsserver.eof
outcon=outcon&DNSOP(dnsserver("site"),"/zonedelete "&ComX.idntoac_7i24_com(Cstr(dsdom("domain"))),dnsserver("FreeHostsharekey"))
dnsserver.movenext
wend
dnsserver.close
end if
while not dsALLDNS.Eof
dsALLDNS.delete
dsALLDNS.update
dsALLDNS.movenext
wend
dsALLDNS.close
end if

		Sql="delete from FreeHost.FreeHost_Product_ALLDNS where PdDID='"&dsdom("id")&"'"
  conn.Execute Sql


FreeHost_oplog session("admusername"),"信息","管理员删除域名"&dsdom("Domain")

dsdom.delete
dsdom.update
Response.Redirect "opinfo.asp?e=强行删除成功。"&outcon
'else
'	ef=True
'	ec="只有处于正常状态的域名才能强行删除。"
'end if
end if

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