<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
CNuseOriDNS=False'当设置为True时，CN类域名强行调用原始注册商的DNS
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
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 (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and  id ='"&Request("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,1
if dsdom.Eof then
	ef=True
	ec="不存在的域名！"
end if
end if

If not ef then
if not dsdom("status")="正常" then
		ef=True
		ec="必须是成功注册或处于正常状态的域名才能管理！"
end if
end If

If not ef then
if IsNull(dsdom("inipass")) then
		ef=True
		ec="密码为空，请您先击重置密码！"
end if
end if

if not ef then
Enddomaintypeid=GetDomaintype(dsdom("Domain"))
end if

if not ef then
session("Domain_type1")=dsdom("type1")
session("domain")=dsdom("domain")
session("inipass")=dsdom("inipass")
session("api7select")=dsdom("api7select")

If Right(dsdom("Domain"),3)<>".cn" And CNuseOriDNS=True Then isCNdoing=true
if dsdom("DNS_API")=1 Or dsdom("api7select")=2 Or isCNdoing=true then

session("httpscookie")=""
session("DNSAUID")=dsdom("id")
session("Domain_API")=dsdom("Domain_API")
if dsdom("DNS_API")=1 then
session("DNS_API")=1'STARTOUT DNS
else
session("DNS_API")=0'ORI dns
end if

Response.Redirect "/dns/logininfo.asp"
end If


if dsdom("Domain_API")=100 then
urlD="http://mgt.dns.com.cn"

If dsdom("type1")=0 then
if Application("showdomainpass")=true then


sTime = DateDiff("s", "1970-1-1 0:00:00", DateAdd("s",-28800,Now))
auth = md5(md5(dsdom("inipass"))&md5(Application("Domain_Agent_password_1_API"))&"Q#!*&^VMXP")
key = md5(Application("Domain_Agent_username_1")& dsdom("domain") & left(sTime, len(sTime) - 3) & "ZL*$@,>HDY")
strSend = "domainName="&server.URLEncode(dsdom("domain"))&"&auth="&auth&"&key="&Key
ret = Post_RetrunStr("http://mgt.dns.com.cn/main/domain_epp.php",strSend)
tokeary=Split(ret,"token")
token=Replace(tokeary(1),"""}","")
token=Replace(token,""":""","")
If token="" Then 
Response.write "验证失败，请检查密码，或重置密码后再试"
Response.End
Else
response.redirect "http://mgt.dns.com.cn/main/domain_tmp.php?token="&token
End If

End If
End if

elseif dsdom("Domain_API")=2 and (Enddomaintypeid=6 )  then
urlD="http://mns.xinnet.com"
elseif dsdom("Domain_API")=2 then
if Application("showdomainpass")=true then
domarry=split(session("domain"),".")
domtemp=right(session("domain"),len(session("domain"))-len(domarry(0)))
Response.CodePage=65001
Response.Charset="UTF-8" 
%>

<script type="text/javascript" src="http://dcp.xinnet.com/Modules/agent/domain/js/jquery.js"></script>
<script type="text/javascript" src="http://dcp.xinnet.com/Modules/agent/domain/js/core-min.js"></script>
<script type="text/javascript" src="http://dcp.xinnet.com/Modules/agent/domain/js/aes.js"></script>
<script type="text/javascript" src="http://dcp.xinnet.com/Modules/agent/domain/js/regreg.js?v=1"></script>
<script type="text/javascript">
<!--
	function domain_login(){
		var domainName= document.forms.form1.domainName.value;
		var password =encodepwd(document.forms.form1.password.value);
		document.forms.form1.password.value=password;
    }

//-->
</script>

<form name="form1" method="post" action="http://dcp.xinnet.com/domainLogin.do?method=domainEnter" ID="Form1">
<input name="domainName" type="hidden" value="<%=dsdom("Domain")%>">
<input name="password" type="hidden" value="<%=dsdom("inipass")%>">
<img id="validateCodeImg"  src="http://dcp.xinnet.com/Modules/agent/domain/validate_picture.jsp" height="30" width="65" align="top">
<input name="checkCode" type="text" style="width:40px" />
<input type="submit" name="Submit" value="<%If ef then%>Error if you want to login pls click here<%else%>login...........<%End if%>"  onClick="domain_login();">
</form>
<script language="JavaScript">
//document.Form1.submit();
</script>


<%response.end




'If  Enddomaintypeid=7 Or Enddomaintypeid=3 Then '转向到新网中文域名中
'urlD="http://mns.xinnet.com"
'End if

'旧的dns
'urlD="https://www.paycenter.com.cn/cgi-bin/nEWpAYcENTER/Domain/DomainLogin?Domain="&domarry(0)&"&Suffix="&domtemp&"&Password="&server.URLEncode(session("inipass"))&"&B1=%A1%A1%B5%C7%A1%A1%C2%BC%A1%A1"
'If  Enddomaintypeid=7 Then urlD="https://www.paycenter.com.cn/cgi-bin/nEWpAYcENTER/Domain/DomainLogin?Domain="&session("domain")&"&Suffix=&Password="&server.URLEncode(session("inipass"))&"&B1=%A1%A1%B5%C7%A1%A1%C2%BC%A1%A1"


else
urlD="http://mydns2.xinnet.com"
'urlD="http://dcp.xinnet.com"
end if
elseif dsdom("Domain_API")=3 or dsdom("Domain_API")=1 then
urlD="http://dnsmsn.com/login/domain/doLogin.do"
%>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<form name="form1" method="post" action="<%=urlD%>" ID="Form1">
<input name="domainName" type="hidden" value="<%=dsdom("Domain")%>">
<input name="password" type="hidden" value="<%=dsdom("inipass")%>">

<input type="submit" name="Submit" value="login...........">
</form>
<script language="JavaScript">
document.Form1.submit();
</script>

<%
response.end
elseif dsdom("Domain_API")=4 then
urlD="http://www.dns-diy.com"

Response.CodePage=65001
Response.Charset="UTF-8" 
%>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<form name="form1" method="post" action="http://www.dns-diy.com/login.aspx" ID="Form1">
<input name="username" type="hidden" value="<%=dsdom("Domain")%>">
<input name="password" type="hidden" value="<%=session("inipass")%>">
<input type="submit" name="Submit" value="login...........">
</form>
<script language="JavaScript">
document.Form1.submit();
</script>


<%
response.end

elseif dsdom("Domain_API")=5 then
urlD="http://diy.hichina.com"
elseif dsdom("Domain_API")=7 then
urlD="http://access.enom.com"
If Application("api7select")=1 Then urlD="http://dns.world-server.net"
If Application("api7select")=2 Then Response.Redirect "e.asp?e=本接口必须用自己的DNS"
elseif dsdom("Domain_API")=6 Then

If Application("api6select")=1 Then'百度
session("DNSAUID")=dsdom("id")
response.redirect"/BCD/dns/BCD.asp"
response.end
End If

'-------------以下是登录中国数据代码-------------------

'确保Application("Domain_Agent_url_6")、Application("Domain_Agent_username_6")、Application("Domain_Agent_password_6")都存在
'登录中国数据
	If LCase(Application("Domain_Agent_url_6"))="http://api.zgsj.com" Then
		api6DomainLoginCp=Application("Domain_Agent_url_6")&"/agentserver/domain/api.asp?method=DomainLoginCp"
		dn=dsdom("Domain")
		checksum=MD5("DomainLoginCp"+Application("Domain_Agent_username_6")+Application("Domain_Agent_password_6")+dn)
		body="client="&Application("Domain_Agent_username_6")&"&name="+server.URLEncode (dn)+"&checksum="&checksum
		retdns=ONLY_POST(api6DomainLoginCp,api6DomainLoginCp,body)
		If Instr(retdns, "&info=")<=0 Then
			Response.write "登录失败，错误原因："&server.URLEncode (retdns):Response.End
		Else
			tmep=split(retdns,"&info=")
			loginurl=tmep(1)
			Response.redirect loginurl
			Response.End
		End If
	End If

'-------------以上是登录中国数据代码-------------------

api6admurl=Application("Domain_Agent_url_6")&"/dns/dnslogin.asp"
%>

<meta http-equiv="content-type" content="text/html; charset=gb2312">
<form name="form1" method="post" action="<%=api6admurl%>" ID="Form1">
<input name="domain" type="hidden" value="<%=dsdom("Domain")%>">
<input name="inipass" type="hidden" value="<%=dsdom("inipass")%>">
<input name="api" type="hidden" value="6">
<input type="submit" name="Submit" value="login...........">
</form>
<script language="JavaScript">
document.Form1.submit();
</script>

<%
response.end
end if

end if


if not ef then
If urlD<>"" Then Response.Redirect urlD
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>