<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
 
id=session("DNSAUID")
Aid=Request("Aid")
If session("DNSAUID")="" Then
	ef=True
	ec="授权非法，请您先登陆。"
ElseIf not IsNumeric(id)  Then
	ef=True
	ec="ID应该是数字！"
ElseIf not IsNumeric(Aid)  Then
	ef=True
	ec="ID应该是数字！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsdm = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Domain where id='"&id&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
outcon="非法字符！"
Response.End
end if
	dsdm.Open Sql,conn,1,1
if dsdm.Eof then
	ef=True
	ec="不存在的域名！"
end if
end if

if not ef then
 	Set dsURLRE = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_URLRE where PdDID='"&id&"' and id='"&Aid&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
outcon="非法字符！"
Response.End
end if
	dsURLRE.Open Sql,conn,1,3
if dsURLRE.Eof then
	ef=True
	ec="不存在的记录！"
end if
end if

if not ef then
'dsALLDNS.addnew
'dsALLDNS("username")=dsdm("username")
'dsALLDNS("PdDID")=dsdm("id")
'dsALLDNS("RRType")="A"
'dsALLDNS("RRData")=Request.Form ("RRData")
'dsALLDNS("NodeName")=Request.Form ("NodeName")
'dsALLDNS("TTL")=Request.Form ("TTL")
NodeName=dsURLRE("NodeName")


OriDomain=dsdm("domain")
OriDomain=replace(OriDomain,".中国",".cn")
OriDomain=replace(OriDomain,".公司",".com.cn")
OriDomain=replace(OriDomain,".网络",".net.cn")
newdomain=ComX.idntoac_7i24_com(Cstr(OriDomain))

Set dnsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerDNSlist"
	dnsserver.Open Sql,conn,1,1
while not dnsserver.eof
outcon=DNSOP(dnsserver("site"),"/RecordDelete "&newdomain&" "&dsURLRE("NodeName")&" CNAME",dnsserver("FreeHostsharekey"))
dnsserver.movenext
wend
dnsserver.close



 	Set dsALLDNS = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLDNS where PdDID='"&id&"' and NodeName='"&NodeName&"' and RRType='CNAME'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
outcon="非法字符！"
Response.End
end if
	dsALLDNS.Open Sql,conn,1,3	
while not dsALLDNS.eof
dsALLDNS.delete
dsALLDNS.movenext
wend
dsALLDNS.close

dsURLRE.delete
dsURLRE.update
dsURLRE.close

 	Set dsALLDNS = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLDNS where PdDID='"&id&"'"
	dsALLDNS.Open Sql,conn,1,1
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
while not dnsserver.eof
outcon=DNSOP(dnsserver("site"),"/zonedelete "&newdomain,dnsserver("FreeHostsharekey"))
dnsserver.movenext
wend
dnsserver.close
end if


%>
<HTML><HEAD><TITLE>Mydns</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<style type="text/css">
<!--
BODY {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TABLE {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TR {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TD {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
P {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
INPUT {
	COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
SELECT {
	COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TEXTAREA {
	COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
BODY {
	BACKGROUND: #ffffff; COLOR: #000000
}
.inputText {
	BACKGROUND: #ffffff; BORDER-BOTTOM: #c0c0c0 1px solid; BORDER-LEFT: #c0c0c0 1px solid; BORDER-RIGHT: #c0c0c0 1px solid; BORDER-TOP: #c0c0c0 1px solid
}
.inputRadio {
	BACKGROUND: #e8e8e8
}
.formHeader {
	BACKGROUND: #d0d0d0; COLOR: #000000; FONT-WEIGHT: bold
}
.formSubHeader {
	BACKGROUND: #e0e0e0; COLOR: #000000; FONT-WEIGHT: bold
}
.formItem {
	BACKGROUND: #e8e8e8; COLOR: #000000
}
.formText {
	BACKGROUND: #f0f0f0; COLOR: #000000
}
.formError {
	COLOR: #ff0000
}
.mainBorder {
	BACKGROUND: #666666
}
.mainHeader {
	BACKGROUND: #ffffff
}
.mainBody {
	BACKGROUND: #ffffff
}
.mainItem {
	BACKGROUND: #cccccc; FONT-WEIGHT: bold
}
.mainFooter {
	BACKGROUND: #ffffff
}
.mboxBorder {
	BORDER-BOTTOM: #d0d0d0 1px solid; BORDER-LEFT: #d0d0d0 1px solid; BORDER-RIGHT: #d0d0d0 1px solid; BORDER-TOP: #d0d0d0 1px solid
}
A {
	COLOR: #ff9900; TEXT-DECORATION: none
}
A:link {
	COLOR: #ff9900
}
A:visited {
	COLOR: #ff9900
}
A:active {
	COLOR: #ff9900; TEXT-DECORATION: underline
}
PRE {
	FONT-FAMILY: Lucida Console, Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
-->
</style>
</head>
<BODY onload="" topmargin="0">
<TABLE border=0 align="center" cellPadding=0 cellSpacing=0 class=mainBorder>
  <TBODY>
  <TR>
     <TD>
        <table border="0" cellspacing="0" cellpadding="0" align="center" height="46">
                <tr>
                  <td height="46" width="84%" rowspan="2">&nbsp;</td>
                  <td height="30" width="16%">&nbsp;</td>
                </tr>
                <tr>
                  <td height="16" width="16%">&nbsp;</td>
                </tr>
       </table>
     </TD>
  </TR>
  <TR>
    <TD>
 <table align="center" bgcolor="#cccccc" border="0" cellpadding="3" cellspacing="1" class="content" width="700">
        <tbody> 
        <tr bgcolor="#e8e8e8"> 
          <td class="content" height="28"> 
            <div align="center"> <font color="#000000" size=12px><span style="letter-spacing: 2"><font size="2"><b> 
                  MYDNS </b></font></span></font></div>
          </td>
        </tr>
        <tr> 
              <td bgcolor="#ffffff" height="81" class="unnamed1"><font face="宋体" size="2"><span style="letter-spacing: 2">
              　　操作成功<span class="unnamed1"><br>
              <br>　　
              <a href="mydns.asp?id=<%=dsdm("id")%>">[返回]</a></span></span></font></td>
        </tr>
        <tr> 
              <td bgcolor="#ffffff" class="unnamed1"><span style="letter-spacing: 2"></span></td>
        </tr>
        </tbody> 
      </table>
  
            </TD>
</TR></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</BODY></HTML>
<%
dsdm.close
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
