<%@ Language=VBScript %>
<%server.scripttimeout=240%>
<!--#include virtual="/inc-freehost-function/FreeHostEmail.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
Function SystemTest(URL,FreeHostsharekey)
Set MaintoCSCom=Server.CreateObject("www.7i24.com")
RetInfo=MaintoCSCom.DOHTTPSSL(Url&"?",FreeHostsharekey," ",FreeHost_t1,FreeHost_t2,FreeHost_t3,FreeHost_t4)
Set MaintoCSCom =Nothing
SystemTest=RetInfo
End Function

isagentpd=False
If session("username")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("tiaokuan")<>"y"  Then
	ef=True
	ec="请您先选择同意服务条款！"
ElseIf Request ("id")="" Then
	ef=True
	ec="请选择产品！"
ElseIf Instr(1, Request ("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
ElseIf not IsNumeric(Request ("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf not IsNumeric(Request ("ServerlistID"))  Then
	ef=True
	ec="机房ID应该是数字！"
ElseIf IsNumeric(Request ("Ftpname"))  Then
	ef=True
	ec="FTP用户名不能是纯数字！"
ElseIf not IsNumeric(Request ("year"))  Then
	ef=True
	ec="时间应该是数字！"
ElseIf Request ("Ftpname")="" Then
	ef=True
	ec="请设置FTP用户名！"
ElseIf Len(Request ("Ftpname"))<6 Then
	ef=True
	ec="FTP用户名长度不能小于6位！"
ElseIf Trim(LCase(Request ("Ftpname")))="self" or Trim(LCase(Request ("Ftpname")))="adm" or Trim(LCase(Request ("Ftpname")))="admin" or Trim(LCase(Request ("Ftpname")))="sefreehost" Or Trim(LCase(Request ("Ftpname")))="administrator" Or Trim(LCase(Request ("Ftpname")))="freehost" Or Trim(LCase(Request ("Ftpname")))="proxy" Or Trim(LCase(Request ("Ftpname")))="windows" Or Trim(LCase(Request ("Ftpname")))="system32" Or Trim(LCase(Request ("Ftpname")))="system" Or Trim(LCase(Request ("Ftpname")))="service" Then
	ef=True
	ec="您输入的FTP用户名为保留用户名，请换一个ftp用户名"
'ElseIf Request ("Ftppassword")="" Then
'	ef=True
'	ec="请设置FTP密码！"
'ElseIf Request ("Ftppassword")<>Request("reFtppassword") Then
'	ef=True
'	ec="重复输入的FTP密码不一致！"
'ElseIf Request ("Ftppassword")=Request("Ftpname") Then
'	ef=True
'	ec="FTP用户名不能和FTP密码一样,请返回修改！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request ("Ftpname")) Then
	ef=True
	ec="FTP用户名中有非法字符！"
'ElseIf RegExpTest("[^A-Za-z0-9]",Request ("Ftppassword"))  or len(Request ("Ftppassword"))<9 Then
'	ef=True
'	ec="FTP密码有非法字符，只能是字母与数字,而且密码长度不能小于10位！"
end If

if not ef Then
Ftpname=LCase(Trim(Request ("Ftpname")))'2009624
'Ftppassword=Trim(Request ("Ftppassword"))'2009624
Randomize
ftpRkey=CLng((100000000 - 20 + 7850) * Rnd + 100)
Ftppassword=Ucase(Left(md5(now&ftpRkey),10))&right(md5(now&ftpRkey),4)'2010-8-5

HostListpdid=Request ("id")
ReqServerlistID=CStr(Request("ServerlistID"))
End If

if not ef then
if DateDiff("s", Application("hostoptime"),NOW )<180 and Application("hostoplock")=true then
	ef=True
	ec="系统繁忙，前一个网站开通操作尚未处理完，请您稍等两分钟后再试，谢谢您的支持。"
end If
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&session("username")&"'"
		ds.Open Sql,conn,1,3
if ds.eof then
	ef=True
	ec="用户不存在!"
end if
end if

if not ef then
if ds("password")<>session("password") then
	ef=True
	ec="密码不正确!"
end if
end if

if not ef then
	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where id='"&HostListpdid&"'"
	dshost.Open Sql,conn,1,1
if dshost.Eof then
	ef=True
	ec="产品不存在！"
Else
If dshost ("isagentpd")=True Then isagentpd=true'代理的产品
packagename=dshost("packagename")'linux
ServerlistID=dshost ("ServerlistID")'机房选择
if dshost("isagentpd")=false then
if  ReqServerlistID=cstr(dshost ("ServerlistID2")) and dshost ("ServerlistID2")<>0 then ServerlistID=dshost ("ServerlistID2")
if  ReqServerlistID=cstr(dshost ("ServerlistID3")) and dshost ("ServerlistID3")<>0 then ServerlistID=dshost ("ServerlistID3")
if  ReqServerlistID=cstr(dshost ("ServerlistID4")) and dshost ("ServerlistID4")<>0 then ServerlistID=dshost ("ServerlistID4")
if  ReqServerlistID=cstr(dshost ("ServerlistID5")) and dshost ("ServerlistID5")<>0 then ServerlistID=dshost ("ServerlistID5")
End if
if ds("agent1")<>"n" then
	Set agnserverid = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist_AGN where id='"&HostListpdid&"' and agent1='"&ds("agent1")&"'"
	agnserverid.Open Sql,conn,1,1
dim isAgnHostSer
if not agnserverid.Eof then
if agnserverid ("ServerlistID")<>0 then
ServerlistID=agnserverid ("ServerlistID")
isAgnHostSer=true
else
isAgnHostSer=false
end if
end if
end if'isagn
end if
end If

if not ef then
If Request ("year")<>999 and Request ("year")<>dshost("PAY_Month") and Request ("year")<>dshost("PAY_Season")  and Request ("year")<>dshost("PAY_halfyear") and Request ("year")<>1 and Request ("year")<>dshost("PAY_2year") and Request ("year")<>dshost("PAY_3year") and Request ("year")<>dshost("PAY_4year") and Request ("year")<>dshost("PAY_5year") Then
	ef=True
	ec="请选择时间！"
end If
end if

if not ef then
if dshost("usermoney")=0 then
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where username='"&session("username")&"'"
	dsph.Open Sql,conn,1,1
if not dsph.Eof then
	ef=True
	ec="金额为零的产品，一个用户只能申请一个！"
end if
dsph.close
end if
end if

if not ef then
if Not IsNull(dshost("onlyusebyagn")) Then
If session("agentname")<>dshost("onlyusebyagn") then
	ef=True
	ec="本产品只允许特定的代理使用！"
End if
end if
end If

if not ef then
if dshost("canbyenduser")="n" And session("agentname")="n" then
	ef=True
	ec="本产品不允许最终用户开通！"
end if
end If

if not ef then
if dshost("canbyagnenduser")="n" And session("agentname")<>"n" then
	ef=True
	ec="本产品不允许用户开通！"
end if
end If

if not ef then
if dshost("canbyagn")="n" And session("AgnRunasUser")=true then
	ef=True
	ec="本产品不允许代理开通！"
end if
end if

if not ef then
if Request ("year")=999 and dshost("cantest")="n" then
	ef=True
	ec="很抱歉,本产品不可以试用！"
end if
end if
if not ef then
if Request ("year")=dshost("PAY_Month") and dshost("canmonth")="n" then
	ef=True
	ec="很抱歉,本产品不可以月付！"
end if
end if
if not ef then
if Request ("year")=dshost("PAY_Season") and dshost("canseason")="n" then
	ef=True
	ec="很抱歉,本产品不可以季付！"
end if
end if
if not ef then
if Request ("year")=dshost("PAY_halfyear") and dshost("canhalfyear")="n" then
	ef=True
	ec="很抱歉,本产品不可以半年付！"
end if
end if

'IP黑名单检查
for iX=0 to ubound(Application("blockiparry"))
lenip=Len(Application("blockiparry")(iX))
If lenip>4 then
'response.write Application("blockiparry")(iX)&"<br>"
if Application("blockiparry")(iX)=Left(Request.ServerVariables("REMOTE_ADDR"),lenip) then
	ef=True
	ec="您的IP或IP段"&Request.ServerVariables("REMOTE_ADDR")&"属于黑名单IP:"&Application("blockiparry")(iX)&"@，不允许开通！"
exit for
end If

End if
Next

'response.write ubound(Application("blockiparry"))&Request.ServerVariables("REMOTE_ADDR")
'response.end

'if not ef then
'	Set dsserver = Server.CreateObject("ADODB.Recordset")	
'	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&ServerlistID&"'"
'	dsserver.Open Sql,conn,1,1
'if dsserver.Eof then
'	ef=True
'	ec="服务器不存在！"
'else
 '   netby=dsserver("netby")
'	ip=dsserver("ip")
'	hostip=dsserver("ip")
'	ftpdomain=dsserver("ftpdomain")
'	ostype=dsserver("ostype")
'end if
'end If

If Not isagentpd then'不是代理产品时再执行
if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&ServerlistID&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
Else
    netby=dsserver("netby")
	ip=dsserver("ip")
	hostip=dsserver("ip")
	ftpdomain=dsserver("ftpdomain")
	ostype=dsserver("ostype")
hostip=dsserver("ip")
isuseCDN=dsserver("isuseCDN")	
usecdn1=dsserver("usecdn1")
usecdn2=dsserver("usecdn2")
usecdn3=dsserver("usecdn3")
usecdn4=dsserver("usecdn4")
usecdn5=dsserver("usecdn5")
CDNORIport=dsserver("port")
end if
end If
end if

if not ef then
if isuseCDN=true then
	Set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerCDNlist where id='"&dsserver ("usecdn1")&"'"
	dsCDNserver.Open Sql,conn,1,3
if dsCDNserver.Eof then
	ef=True
	ec="CDN服务器不存在！"
end if
end if
end if

if not ef Then
If ostype="linux" then
If Len(Ftpname)>10 Then
	ef=True
	ec="Linux系统中FTP用户名不能超过10个字符！"
End If
If IsNumeric(Left(Ftpname,1)) Then
	ef=True
	ec="Linux系统中FTP用户名第一个字符不能是数字！"
End if
end if
end If

If Not isagentpd then'不是代理产品时再执行
if not ef then
URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
ostype=dsserver("ostype")
If ostype="linux" then
InCmd="CMD_API_SHOW_ADMINS"
temp=DAAPIGET(URL,"admin",FreeHostsharekey,InCmd)
else
temp=SystemTest(URL,FreeHostsharekey)
End If
if not instr(temp,"成功")>1 and Not InStr(temp,"[]=admin")>1 Then
if instr(temp,"could not be resolved")>0 Then Response.Redirect "e.asp?e=系统暂时不可用，请联系管理员，也可以稍后再试。原因：在主控服务器上，无法解析受控域名，请在主控服务器上ping 受控域名试试。"
Response.Redirect "e.asp?e=系统暂时不可用，请联系管理员在管理区自检来了解原因，也可以稍后再试。内部原因:"&temp
Else
if (instr(temp,"2011")>1 or instr(temp,"2012")>1 or instr(temp,"2013")>1 or instr(temp,"2014")>1 or instr(temp,"2015")>1 or instr(temp,"2016")>1 or instr(temp,"2017")>1 or instr(temp,"2018")>1) and  ostype="windows" Then isnewCS=true
end If
end If
End if

if not ef then
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where Ftpname='"&Ftpname&"'"
	dsph.Open Sql,conn,1,1
if not dsph.Eof then
	ef=True
	ec="您输入的FTP用户名已存在，请另外输入一个！"
end if
dsph.close
end if

If Not isagentpd then'不是代理产品时再执行
if not ef then 'test hostname
if ds("agent1")<>"n" and len(dsserver("tempdomainagn"))>3 then
hostname=":80:"&Ftpname&"."&dsserver("tempdomainagn")&","
else
hostname=":80:"&Ftpname&"."&dsserver("tempdomain")&","
end if
'if Application("openmustre")=false Then
if dsserver("openmustre")=false Then
If (Request ("year")=999 and Application("testhostcandomain")=true) Or Request ("year")<>999 then
if trim(Request.Form ("hostname1"))<>"" then
hostname=hostname&":80:"&replace(replace(Request.Form ("hostname1"), " ",""),":80:","")&","

domain=replace(lcase(trim(Request.Form ("hostname1"))),"http://","")

domain=ComX.idntoac_7i24_com(cstr(domain))
domain=GetDomainMain(domain)
if dsserver("autodelicp")=true then'如果启用后台检查
	Set dsICPDB = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ICPDB where domain='"&domain&"'"
	dsICPDB.Open Sql,conn,1,3
if dsICPDB.Eof Then
dsICPDB.addnew
dsICPDB("username")=ds("username")
dsICPDB("ftpname")=Ftpname
dsICPDB("domain")=domain
dsICPDB("status")="尚未检测"
dsICPDB("firstaddtime")=Now
dsICPDB("agent1")=ds("agent1")
dsICPDB("agent2")=ds("agent2")
dsICPDB.update
end If
dsICPDB.close
End if

end if

end If
end if

if right(hostname,1)="," then hostname=left(hostname,len(hostname)-1)
'response.write hostname
hostname=replace(hostname,"http://","")
hostname=lcase(replace(hostname,"　",""))






if hostname<>"" then
'hostname=trim(replace(Request.Form ("hostname")," ",""))
hostname_arry=Split(hostname, ",")
for i=0 to ubound(hostname_arry)
	Set dshostname = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where hostname+',' like '%"&hostname_arry (i)&",%' and ServerlistID='"&ServerlistID&"'"
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dshostname.Open Sql,conn,1,1
if not dshostname.Eof then
	ef=True
	ec="您要绑定的域名"&replace(hostname_arry (i),":80:","")&"已存在，其他用户绑定了这个用户名，FTP是："&dshostname("ftpname")
end if
dshostname.close
Set dshostname = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Agent_ALLdomain where domain = '"&replace(hostname_arry (i),":80:","")&"'"
	dshostname.Open Sql,conn,1,1
if not dshostname.Eof then
	ef=True
	ec="您要绑定的域名"&replace(hostname_arry (i),":80:","")&"已存在,其他代理商在服务域名中绑定了这个域名！代理名是："&dshostname("username")
end if
dshostname.close
for iX=0 to ubound(Application("sitearry"))
if Application("sitearry")(iX)=replace(hostname_arry (i),":80:","") or Request.ServerVariables("LOCAL_ADDR")=replace(hostname_arry (i),":80:","") then
	ef=True
	ec="您要绑定的域名"&replace(hostname_arry (i),":80:","")&"已存在于主控域名中！"
exit for
end if
Next

for iX=0 to ubound(Application("blockdomainarry"))
If Len(Application("blockdomainarry")(iX))>1 then
if InStr(LCase(replace(hostname_arry (i),":80:","")),Application("blockdomainarry")(iX))>0 then
	ef=True
	ec="您要绑定的域名"&replace(hostname_arry (i),":80:","")&"属于黑名单域名，不允许绑定！"
exit for
end If
End if
next

next
end if
end If
End if

if not ef then
Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where username='"&session ("username")&"' and istest='y'"
	dsph.Open Sql,conn,1,3
if Request ("year")=999 then
if not dsph.Eof then
	ef=True
	ec="一个用户只能试用一个产品！"
end if
end if
end if

'if not ef then'time
'if Application("Hostopen_Time")="" then
'Application("Hostopen_Time")=now
'else
'Application.lock
'if DateDiff("s", Application("Hostopen_Time"),NOW )<40 then
'	ef=True
'	ec="请稍后再试，系统设置40秒内只能开通一个用户！"
'else
'Application("Hostopen_Time")=now
'end if
'Application.unlock
'end if
'end If


if not ef then

dim starttime,temptime,pdtype
pdtype=dshost("Hosttype")
starttime=NOW
'结束时间
y=Request ("year")
if y=1 then temptime=dateadd("yyyy",1,now)
if y=dshost("PAY_2year") then temptime=dateadd("yyyy",2,now)
if y=dshost("PAY_3year") then temptime=dateadd("yyyy",3,now)
if y=dshost("PAY_4year") then temptime=dateadd("yyyy",4,now)
if y=dshost("PAY_5year") then temptime=dateadd("yyyy",5,now)
if y=dshost("PAY_Month") then temptime=dateadd("y",31,now)
if y=dshost("PAY_Season") then temptime=dateadd("y",92,now)
if y=dshost("PAY_halfyear") then temptime=dateadd("y",182,now)
if y=999 then
temptime=dateadd("y",Application("testtime"),now)
dim isfortest
isfortest=true
end if

dim ef,ec,Userpaymoney,forpaytype,olduser_money,moneych,newuser_money,oldagn_money,mymoneych,newagn_money,Useragentname,agent_UP,agent_thisgree_cost,agent_this_name,logfor,pubisagnSer,AgnRunasUser
Userpaymoney=dsHost("usermoney")
forpayyear=Request ("year")
set RsUserds=ds
Useragentname=ds("agent1")
forpaytype="虚拟主机"
forpayid=dshost("id")
logfor="用户区开通(FTP名"&Ftpname&")"
pubisagnSer=isAgnHostSer
AgnRunasUser=session("AgnRunasUser")
DoPayMoney
end if

if not ef then
dim Subject,body'send mail
dsph.AddNew
dsph("username")=ds ("username")
if dshost("isagentpd")=false then
dsph("ServerlistID")=dsserver("id")
End if
dsph("Hosttype")=dshost("Hosttype")
dsph("oriHosttype")=dshost("Hosttype")
dsph("starttime")=starttime
dsph("endtime")=temptime

dsph("CDNMaxMb")=dshost("CDNMaxMb")
dsph("Maxbytes")=dshost("Maxbytes")
dsph("MaxCPU")=dshost("MaxCPU")

dsph("ostype")=ostype

dsph("Ftpname")=Ftpname
dsph("Ftppassword")=Ftppassword
dsph("hostname")=hostname
If Not isagentpd then'不是代理产品时再执行
if hostname="" then '生成临时
dsph("hostname")=":80:"&dsph ("Ftpname")&"."&dsserver("tempdomain")
if ds("agent1")<>"n" and len(dsserver("tempdomainagn"))>3 then
dsph("hostname")=":80:"&dsph ("Ftpname")&"."&dsserver("tempdomainagn")
end if
end If
End if
dsph("status")="准备开通"
if y=999 then
dsph("istest")="y"
else
dsph("istest")="n"
end if

if ds("agent1")<>"n" then
dsph("agent1")=ds("agent1")
else
dsph("agent1")="n"
end if

dsph("allowsub")=dshost("allowsub")
dsph("subweb")=dshost("subweb")
dsph("useper")=100

dsph("canseelog")=dshost("canseelog")
dsph("canrar")=dshost("canrar")
dsph("canback")=dshost("canback")
dsph("canrecypool")=dshost("canrecypool")

dsph("canchnetver")=dshost("canchnetver")
dsph("notuserar")=dshost("notuserar")

dsph("kefu")=ds("kefunow")

dsph.Update


'LOG
Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where Ftpname='"&Ftpname&"'"
	dsph.Open Sql,conn,1,3
Sql="UPDATE [FreeHost].[FreeHost_Moneylog] set pdid='"&dsph("id")&"' where pdid='"&session("moneylog_pdid")&"'"
    conn.Execute Sql

if isAgnHostSer=false then 
if dshost("isbydomain")="y" then
'送域名
	Set dspre = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Preopen_Product"
	dspre.Open Sql,conn,1,3
dspre.addnew
dspre("username")=ds("username")
dspre("haveget")="n"
dspre("byid")=dsph("id")
dspre("type1")=dshost("Domaintype")
dspre("whichProduct")="虚拟主机"
dspre("attime")=now
dspre("agent1")=ds("agent1")
dspre.update
dspre.close
set dspre=nothing
end if
end if

'开通邮箱
haveopenemail=False
openemailid=0
	Set dsemailpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_EmailProductlist where Hosttype='"&dshost("Hosttype")&"' and isbyhost='y'"
	dsemailpdlist.Open Sql,conn,1,1
if not dsemailpdlist.Eof then

ServerlistID=dsemailpdlist ("ServerlistID")
	Set dsemailserver = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Serveremaillist where netby='"&netby&"' and agent1='n'"
		dsemailserver.Open Sql,conn,1,1
while not dsemailserver.Eof
 if ( dsemailpdlist ("ServerlistID2")=dsemailserver ("id")  or dsemailpdlist ("ServerlistID3")=dsemailserver ("id") or dsemailpdlist ("ServerlistID4")=dsemailserver ("id") or dsemailpdlist ("ServerlistID5")=dsemailserver ("id")) then
 ServerlistID=dsemailserver("id")'优先选择可选机房中的同机房
 end if
dsemailserver.movenext
wend
dsemailserver.Requery
while not dsemailserver.Eof
 if ip=dsemailserver("ip") and ( dsemailpdlist ("ServerlistID2")=dsemailserver ("id")  or dsemailpdlist ("ServerlistID3")=dsemailserver ("id") or dsemailpdlist ("ServerlistID4")=dsemailserver ("id") or dsemailpdlist ("ServerlistID5")=dsemailserver ("id")) then
 ServerlistID=dsemailserver("id")'优先选择可选机房中的同IP
 end if
dsemailserver.movenext
wend
dsemailserver.close


	Set agnserverid = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_EmailProductlist_AGN where id='"&dsemailpdlist ("id")&"' and agent1='"&ds("agent1")&"'"
	agnserverid.Open Sql,conn,1,1
if not agnserverid.Eof then
if  agnserverid ("ServerlistID")<>0 then ServerlistID=agnserverid ("ServerlistID")
end if


Set dsphemail = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where username='"&session ("username")&"'"
	dsphemail.Open Sql,conn,1,3
dsphemail.addnew
dsphemail("username")=ds("username")

dsphemail("ServerlistID")=ServerlistID
dsphemail("Emailtype")=dsemailpdlist("Emailtype")
dsphemail("starttime")=starttime
dsphemail("endtime")=temptime
dsphemail("byhost")=dsph("id")
if y=999 then
dsphemail("istest")="y"
else
dsphemail("istest")="n"
end if

dsphemail("emailcount")=dsemailpdlist("emailcount")
dsphemail("userspacelimt")=dsemailpdlist("userspacelimt")
dsphemail("domainspacelimt")=dsemailpdlist("domainspacelimt")
dsphemail("domainmustsame")=dsemailpdlist("domainmustsame")
dsphemail("status")="正常"

if ds("agent1")<>"n" then
dsphemail("agent1")=ds("agent1")
else
dsphemail("agent1")="n"
end if

dsphemail.update
dsphemail.close

'log
	Set dsphemail = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where starttime='"&starttime&"' and username='"&ds("username")&"'"
	dsphemail.Open Sql,conn,1,1
'response.write "赠送的邮箱产品已开通!!!!!!"
retemail="赠送的邮箱产品已开通"
FreeHost_oplog session("username"),"信息","用户自己开通，虚拟主机("&dsph ("Ftpname")&")赠送邮箱ID:"&dsphemail("id")

haveopenemail=true
openemailid=dsphemail("id")

end if

'送CDN
haveopenCDN=False
	Set dsCDNpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_CDNProductlist where id='"&dshost("CDNpdID")&"'"
	dsCDNpdlist.Open Sql,conn,1,1
if Not dsCDNpdlist.Eof Then
Set dsphCDN = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_CDN where username='"&session ("username")&"'"
	dsphCDN.Open Sql,conn,1,3
haveopenCDN=true
dsphCDN.addnew
dsphCDN("username")=ds ("username")
dsphCDN("CDNtype")=dsCDNpdlist("CDNtype")
dsphCDN("starttime")=starttime
dsphCDN("endtime")=temptime
dsphCDN("allowdomain")=dsCDNpdlist("allowdomain")
dsphCDN("CDNMaxMb")=dsCDNpdlist("CDNMaxMb")
dsphCDN("Bindserverid1")=dsCDNpdlist("Bindserverid1")
dsphCDN("Bindserverid2")=dsCDNpdlist("Bindserverid2")
dsphCDN("ftpname")=dsph ("Ftpname")
dsphCDN("ftppassword")=dsph ("ftppassword")
dsphCDN("status")="正常"
if y=999 then
dsphCDN("istest")="y"
else
dsphCDN("istest")="n"
end if
if ds("agent1")<>"n" then
dsphCDN("agent1")=ds("agent1")
else
dsphCDN("agent1")="n"
end if
dsphCDN("kefu")=ds("kefunow")
dsphCDN.Update
End if


'SQL
haveopensql=False
	Set dsSqlpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select top 1 * from FreeHost.FreeHost_SqlProductlist where Hosttype='"&dshost("Hosttype")&"' and isbyhost='y'"
If isAgnHostSer=True Then Sql="Select top 1 * from FreeHost.FreeHost_SqlProductlist where Hosttype='"&dshost("Hosttype")&"' and isbyhost='y'"
If IsNumeric(Request.Form ("dsSqlpdlistID")) And Request.Form ("dsSqlpdlistID")<>"" Then Sql="Select top 1 * from FreeHost.FreeHost_SqlProductlist where Hosttype='"&dshost("Hosttype")&"' and id='"&Request.Form ("dsSqlpdlistID")&"' and isbyhost='y'"
If dshost("cantwodb")=True Then sql=Replace(sql,"top 1 *","*")'如果产品允许送两个库,2013-9-4
	dsSqlpdlist.Open Sql,conn,1,1
while not dsSqlpdlist.Eof
'12-27修改bug
ServerlistID=dsSqlpdlist ("ServerlistID")
	Set dsSqlserver = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Serversqllist where netby='"&netby&"' and agent1='n'"

		dsSqlserver.Open Sql,conn,1,1
while not dsSqlserver.Eof
 if (dsSqlpdlist ("ServerlistID")=dsSqlserver("id") or dsSqlpdlist ("ServerlistID2")=dsSqlserver("id")  or dsSqlpdlist ("ServerlistID3")=dsSqlserver("id") or dsSqlpdlist ("ServerlistID4")=dsSqlserver("id") or dsSqlpdlist ("ServerlistID5")=dsSqlserver("id")) then
 ServerlistID=dsSqlserver("id")'优先选择可选机房中的同机房
 end if
 dsSqlserver.movenext
wend
dsSqlserver.Requery
while not dsSqlserver.Eof
 if ip=dsSqlserver("ip") and (dsSqlpdlist ("ServerlistID")=dsSqlserver("id") or dsSqlpdlist ("ServerlistID2")=dsSqlserver("id")  or dsSqlpdlist ("ServerlistID3")=dsSqlserver("id") or dsSqlpdlist ("ServerlistID4")=dsSqlserver("id") or dsSqlpdlist ("ServerlistID5")=dsSqlserver("id")) then
 ServerlistID=dsSqlserver("id")'优先选择可选机房中的同一IP
 end if
  dsSqlserver.movenext
wend
dsSqlserver.close

	Set agnserverid = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_SqlProductlist_AGN where id='"&dsSqlpdlist("id")&"' and agent1='"&ds("agent1")&"'"
	agnserverid.Open Sql,conn,1,1
if not agnserverid.Eof then
if  agnserverid ("ServerlistID")<>0 then ServerlistID=agnserverid ("ServerlistID")
end if


	Set dsserverSQL = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerSqllist where id='"&ServerlistID&"'"
	dsserverSQL.Open Sql,conn,1,1
if not dsserverSQL.Eof then

Set dsphSql = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Sql where username='"&session ("username")&"'"
	dsphSql.Open Sql,conn,1,3



dsphSql.addnew
dsphSql("username")=ds("username")
dsphSql("ServerlistID")=ServerlistID
dsphSql("Sqltype")=dsSqlpdlist("Sqltype")
dsphSql("starttime")=starttime
dsphSql("endtime")=temptime
dsphSql("byhost")=dsph("id")
if y=999 then
dsphSql("istest")="y"
else
dsphSql("istest")="n"
end if

Randomize
sqlname="a"&right("0"& month(Now),2)& right("00" & day(Now),2)& right("00" & hour(Now),2)& right("00"& Minute(Now),2)& right( "00"& second(Now),2)
Randomize
id=CLng((100000000 - 20 + 7850) * Rnd + 100)
sqlpassword=Left(md5(now&id&"7i24.com"),8)
'dsphSql("Sqlcount")=dsSqlpdlist("Sqlcount")
dsphSql("userspacelimt")=dsSqlpdlist("userspacelimt")
dsphSql("logspacelimt")=dsSqlpdlist("logspacelimt")
dsphSql("sqlname")=sqlname
dsphSql("sqlpassword")=sqlpassword
dsphSql("status")="正常"
if ds("agent1")<>"n" then
dsphSql("agent1")=ds("agent1")
else
dsphSql("agent1")="n"
end if
dsphSql.update

URL=dsserverSQL("site")
FreeHostsharekey=dsserverSQL("FreeHostsharekey")
userid=dsserverSQL ("admname")
pwd=dsserverSQL("admpass")
homedir=dsserverSQL("homedir")
ip=dsserverSQL("ip")
port=dsserverSQL("port")
userspacelimt=dsphSql("userspacelimt")
logspacelimt=dsphSql("logspacelimt")
sqlname=dsphSql("sqlname")
sqlpassword=dsphSql("sqlpassword")
'ret=SqlAdd(URL,userid,pwd,homedir,userspacelimt,logspacelimt,sqlname,sqlpassword)
'response.write ret


dim softtype,MySQLver,MSSQLver
softtype=dsserverSQL("softtype")
MySQLver=dsserverSQL("MySQLver")
MSSQLver=dsserverSQL("MSSQLver")

if softtype="SQL2000" then
retsql=SqlAdd(URL,FreeHostsharekey,userid,pwd,homedir,userspacelimt,logspacelimt,sqlname,sqlpassword)
else
retsql=SqlAddmysql(URL,FreeHostsharekey,userid,pwd,homedir,userspacelimt,logspacelimt,sqlname,sqlpassword)
end if

'	dsphSql("status")="正常"
'	dsphSql.update

FreeHost_oplog session("username"),"信息","用户自己开通，虚拟主机("&dsph ("Ftpname")&")赠送数据库,数据库名:"&sqlname&" 返回信息："&retsql
haveopensql=true
dsphSql.close


'log
'	Set dsphSql = Server.CreateObject("ADODB.Recordset")	
'	Sql="Select * from FreeHost.FreeHost_Product_Sql where starttime='"&starttime&"' and username='"&ds("username")&"'"
'	dsphSql.Open Sql,conn,1,3
'	dsphSql("status")="正常"
'	dsphSql.update



end if
dsSqlpdlist.movenext
wend


'调用开通function
If Not isagentpd then'不是代理产品时再执行
AccessFlags=1
if dshost("asp")="y" then
AccessFlags=513
ScriptMaps=dsserver("asp") 
end if

if dshost("aspx")="y" then
AccessFlags=513
netver=dsserver("netver")
If Not IsNull(dshost("netver")) Then netver=dshost("netver")
If netver="1.1" Then ScriptMaps=ScriptMaps&"|"&dsserver("aspx") 
If netver="2.0" Then ScriptMaps=ScriptMaps&"|"&dsserver("aspx2") 
If netver="4.0" Then ScriptMaps=ScriptMaps&"|"&dsserver("aspx4") 
dsph("netver")=netver
end If

if dshost("cgi")="y" then
AccessFlags=517
ScriptMaps=ScriptMaps&"|"&dsserver("cgi") 
end if
if dshost("php")="y" then
AccessFlags=513
ScriptMaps=ScriptMaps&"|"&dsserver("php") 
end If
if dshost("notuserar")="y" then
ScriptMaps=ScriptMaps&"|"&dsserver("notuserar") 
end if


if dsserver("infosafe")<>""  And AccessFlags>1 then
ScriptMaps=ScriptMaps&"|"&dsserver("infosafe") 
end if
ScriptMaps=trim(replace(ScriptMaps,"||","|"))

URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
ostype=dsserver("ostype")
username=dsph ("Ftpname")
password=dsph("Ftppassword")
comment=dsph ("username")
homedir=dsserver("homedir")
spacelimit=dshost ("spacelimt")
starttime=dsph("starttime")
endtime=dsph("endtime")
type1=dsph("Hosttype")
email=ds("email")
host=dsph("hostname")
hostcomment_arry=Split(host, ",")
hostcomment=username&"_"&Replace(hostcomment_arry(0),":80:","")&"_"&dsph ("username")
MaxConnections=dshost ("MaxConnections")
EnumAppsInPool=dshost ("AppPoolnum")

'DefaultDoc=""'dshost ("DefaultDoc")
ScriptMaps=ScriptMaps
AccessFlags=AccessFlags
'LogFileDirectory=""'dsserver ("LogFileDirectory")
'HttpErrors=""'Request.Form ("HttpErrors")
MaxBandwidth=dshost("MaxBandwidth")

hostname=host
 
hostnamestr=replace(hostname, ":80:","")
hostname_arry=Split(hostnamestr, ",")
for i=0 to ubound(hostname_arry)
hostname_arry(i)=ComX.idntoac_7i24_com(cstr(hostname_arry(i)))
next
hostname=""
for i=0 to ubound(hostname_arry)
hostname=hostname&":80:"&replace(replace(hostname_arry(i), " ",""),":80:","")&","
next
if right(hostname,1)="," then hostname=left(hostname,len(hostname)-1)
dsph("hostname")=hostname
dsph.update
host=hostname

if y=999 and Application("testsame")<>true then'如果是试用
MaxConnections=Application("MaxConnections")
spacelimit=Application("spacelimit")
MaxBandwidth=Application("MaxBandwidth")
end if


if dsserver("iisver")>6 Then
hostnamestr=replace(hostname, ":80:","")
hostname_arry=Split(hostnamestr, ",")
for i=0 to ubound(hostname_arry)
hostname_arry(i)=ComX.actoidc_7i24_com(cstr(hostname_arry(i)))
next
hostname=""
for i=0 to ubound(hostname_arry)
hostname=hostname&":80:"&replace(replace(hostname_arry(i), " ",""),":80:","")&","
next
if right(hostname,1)="," then hostname=left(hostname,len(hostname)-1)
host=hostname
End If

if Application("hostoneip")=true Then
Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where ServerlistID="&dsserver("id")&" and HostID=0 order by orderbyid desc"
		dsX.Open Sql,conn,1,3
If not dsX.Eof Then
dsX("HostID")=dsph("id")
host=Replace(host,":80:",dsX("IP")&":80:")
if Application("iphead")=true Then
host=dsX("IP")&":80:"&dsX("IP")&","&host
dsph("iphead")=true
End if
ftpdomain=dsX("IP")
hostip=dsX("IP")
dsX.update
End if
End If

'dim Subject,body


oridir=dshost("oridir")

dsph("AppPoolnum")=dshost("AppPoolnum")'2011
dsph.update

if not ef And isnewCS=True Then
'新的受控
CurPoolname=dsph("AppPoolnum")&"_FreeHost_1"
Curpoolid=1
haneemptypool=False
	Set dsPooldist = Server.CreateObject("ADODB.Recordset")	
Sql="Select distinct CurPoolname from FreeHost.FreeHost_Product_Host where serverlistid='"&dsph("ServerlistID")&"' and hosttype<>'子目录绑定' and AppPoolnum='"&EnumAppsInPool&"' and CurPoolname is not null and CurPoolname like '"&EnumAppsInPool&"_F%' order by CurPoolname Asc"
	dsPooldist.Open Sql,conn,1,1
'	response.write sql
If dsPooldist.Eof Then haneemptypool=true'一个这样的池也没有
Do Until dsPooldist.Eof
CurPoolname=dsPooldist("CurPoolname")
If CInt(Replace(CurPoolname,dsph("AppPoolnum")&"_FreeHost_",""))>Curpoolid Then Curpoolid=CInt(Replace(CurPoolname,dsph("AppPoolnum")&"_FreeHost_",""))
'response.write "<br>"&CurPoolname&"<br>"
Set dsCurPcount = Server.CreateObject("ADODB.Recordset")	
Sql="Select count(*) from FreeHost.FreeHost_Product_Host where serverlistid='"&dsph("ServerlistID")&"' and hosttype<>'子目录绑定' and CurPoolname='"&CurPoolname&"'"
	dsCurPcount.Open Sql,conn,1,1
'	response.write dsCurPcount(0)&"<br>"
	If dsCurPcount(0)<CInt(EnumAppsInPool) Then'池没装完
	If dsCurPcount(0)>0 Then CurPoolname=dsPooldist("CurPoolname")'池名不变
	haneemptypool=true
	Exit do
	End if
	dsCurPcount.close
dsPooldist.movenext
loop
dsPooldist.close
if haneemptypool=False Then CurPoolname=EnumAppsInPool&"_FreeHost_"&CStr(Curpoolid+1)
dsph("CurPoolname")=CurPoolname
dsph.update
End if

'response.write "新的受控...........池名"&CurPoolname&dsph("CurPoolname")

Application.lock
Application("hostoptime")=now
Application("hostoplock")=true
Application.unlock

if isuseCDN=true Then host=Replace(host,":80:",":"&CDNORIport&":")

If isnewCS=true And Not IsNull(dsph("CurPoolname")) Then
siteID=dsph("id")&"000"
outpoolname=dsph("CurPoolname")
op=1
temp="新受控"&AddUser3(URL,FreeHostsharekey,Ftpname,password,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth,siteID,outpoolname,op)
else
temp=AddUser2(URL,FreeHostsharekey,Ftpname,password,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
End if
Application.lock
Application("hostoplock")=false
Application.unlock

FreeHost_oplog session("username"),"信息","用户区，用户开通虚拟主机:("&Ftpname&") "&temp

'Set conn=Server.CreateObject("ADODB.Connection")
'	conn.Open Application("FreeHostDBlink")
Sql="update FreeHost.FreeHost_Product_Host set status='正常' where Ftpname='"&Ftpname&"'"
    conn.Execute Sql

if not isnull(oridir) then
oridir=Replace(oridir,"$ftpname",Ftpname)
todir=replace(homedir&"\web","\\","\")
if len(oridir)>5 then temp=temp&COPYDIR(URL,FreeHostsharekey,oridir,todir)
end if

else'是代理产品时


dsph("isagentpd")=dshost("isagentpd")
dsph("HostComName")=dshost("HostComName")
dsph("HostApiName")=dshost("HostApiName")
dsph("Hostcpdomain")=dshost("Hostcpdomain")
dsph("Agnuserid")=dshost("Agnuserid")
dsph("Domain_Agent_nonemd5_6")=dshost("Domain_Agent_nonemd5_6")
dsph("Agnidc")=dshost("Agnidc")
dsph("Agnproductid")=dshost("Agnproductid")
dsph.update

HostApiName=dsph("HostApiName")
userid=dsph("Agnuserid")
userstr=md5(dsph("Domain_Agent_nonemd5_6")&"7i24.com")
yearAgn=Request.Form ("year")
idc=dsph("Agnidc")
productid=dsph("Agnproductid")
attach=ds("username")
tar="http://"&HostApiName&"/api/Hostapi.asp?userid="&userid&"&userstr="&userstr&"&year="&yearAgn&"&ftpname="&ftpname&"&ftppassword="&dsph ("ftppassword")&"&idc="&idc&"&productid="&productid&"&action=activate&attach="&attach
'Response.write tar
temp=ONLY_GET(tar,"")


FreeHost_oplog session("username"),"信息","用户区，用户开通虚拟主机（代理上级）:("&Ftpname&") "&temp

If InStr(temp,"et=ok") then
Sql="update FreeHost.FreeHost_Product_Host set status='正常' where Ftpname='"&Ftpname&"'"
    conn.Execute Sql
Else
Sql="update FreeHost.FreeHost_Product_Host set status='失败' where Ftpname='"&Ftpname&"'"
    conn.Execute Sql
Response.Redirect "e.asp?e=调用上级API时出错，开通失败，但费用已扣，请联系管理员手工处理！出错原因为："&server.urlencode(temp)
End If

End if'完成是代理的处理







If haveopensql Then
'dim Subject,body
EmailUserSQLOpen
ret=Send2Mail(conn,ds("username"),Subject,body)
End If

If haveopenemail Then
emailopen
ret=Send2Mail(conn,ds("username"),Subject,body)
End if

EmailUserHOSTOpen
ret=Send2Mail(conn,ds("username"),Subject,body)

If Application("smshostopen")=True And (ds("agent1")="n" Or Application("agncangetsms")=True) Then
Dim username
username=ds("username")
mobi=Trim(ds("mobi"))
smsContent=Application("smshostopencon")
'恭喜！您的虚拟主机已开通了！用户名 ：#用户名# FTP地址：#FTP地址#服务器IP ：#IP#FTP用户名 ：#FTP#FTP密码 ：#FTP密码#到期时间是 ：#到期时间#您的帐户余款是 ：#金额# 元
smsContent=Replace(smsContent,"#用户名#",session("username"))
smsContent=Replace(smsContent,"#FTP地址#",ftpdomain)
smsContent=Replace(smsContent,"#IP#",hostip)
smsContent=Replace(smsContent,"#FTP#",Ftpname)
smsContent=Replace(smsContent,"#FTP密码#",password)
smsContent=Replace(smsContent,"#到期时间#",formatdatetime(endtime,1))
smsContent=Replace(smsContent,"#金额#",newuser_money)
ret=SendSms(mobi,smsContent,0,Now,"")
End if

CDNrefreshDomain'更新CDN

conn.close
Set conn=Nothing

%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
　虚拟主机开通成功
<%=htmlwrite("html3")%>
<br>
　　　　　　　　　　　　　<br>
<table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF0000">
  <tr align="center" bordercolor="#000000" bgcolor="#999999">
    <td height="39" colspan="2"><font color="#000000">　　　</font><font color="#990000"><font color="#990000"></font><font color="#FF0000">恭喜您的虚拟主机开通成功，以下是您的资料：</font></font></td>
  </tr>
  <tr bordercolor="#000000" bgcolor="#EEEEEE">
    <td width="39%" height="30"><font color="#000000"> 　　　 您的原金额：</font></td>
    <td width="61%"><font color="#000000"><%=olduser_money%>元</font></td>
  </tr>
  <tr bordercolor="#000000" bgcolor="#EEEEEE">
    <td height="41"><font color="#000000">　　　 您的金额变化：</font></td>
    <td><font color=#000000><%=moneych%> 元</font></td>
  </tr>
  <tr bordercolor="#000000" bgcolor="#EEEEEE">
    <td height="39"><font color="#000000">　　　 您的新金额：</font></td>
    <td><font color="#000000"><%=newuser_money%> 元</font></td>
  </tr>
  <tr bordercolor="#000000">
    <td height="37" bgcolor="#eeeeee"><font color="#000000">　　　 您的FTP用户名：</font></td>
    <td bgcolor="#eeeeee"><%=Ftpname%></td>
  </tr>
  <tr bordercolor="#000000">
    <td height="37" bgcolor="#eeeeee"><font color="#000000"> 　　　 您的FTP密码是：</font></td>
    <td bgcolor="#eeeeee"><%=password%></td>
  </tr>
<%If UBound(hostcomment_arry)>0 then%>
  <tr bordercolor="#000000" bgcolor="#eeeeee">
    <td height="42"><font color="#000000">　　　 </font><font color="#000000"> 您的网址为：</font></td>
    <td height="42"><font color="#000000"><a href="http://<%=Replace(hostcomment_arry(1),":80:","")%>" target=_blank><font color="#000000">http://<%=Replace(hostcomment_arry(1),":80:","")%></font></a></font></td>
  </tr>
<%else%>
  <tr bordercolor="#000000" bgcolor="#eeeeee">
    <td height="42"><font color="#000000">　　　 </font><font color="#000000"> 您的网址为：</font></td>
    <td height="42"><font color="#000000"><a href="http://<%=Replace(hostcomment_arry(0),":80:","")%>" target=_blank><font color="#000000">http://<%=Replace(hostcomment_arry(0),":80:","")%></font></a></font>
<%if session("waitCDNsyn")=true then%>
<br>
<font color=red>注意：您的产品使用了CDN功能，因此新增加或修改的域名您要等候25分钟后才能生效。</font>
<br><br>
<%end if%>
	</td>
  </tr>
<%End if%>
  <tr bordercolor="#000000" bgcolor="#eeeeee">
    <td height="39"><font color="#000000"> 　　　  您的FTP地址是： </font></td>
    <td height="39"><font color="#000000"><font color=red><%=ftpdomain%></font></font></td>
  </tr>
    <tr bordercolor="#000000" bgcolor="#eeeeee">
    <td height="39"><font color="#000000"> 　　　  服务器IP是： </font></td>
    <td height="39"><font color="#000000"><%If isuseCDN=True then%>请进入面板查看<%else%><font color=red><%=hostip%></font><%End if%></font></td>
  </tr>
  <tr bordercolor="#000000">
    <td height="37" bgcolor="#eeeeee"><font color="#000000"> 　　　 到期时间是：</font></td>
    <td bgcolor="#eeeeee"><%=temptime%></td>
  </tr>
<%if y=999 And ostype="windows" then%>
    <tr bordercolor="#000000">
    <td height="60" bgcolor="#eeeeee"><font color="#000000"> 　　　 试用说明：</font></td>
    <td bgcolor="#eeeeee">由于您开通的是试用虚拟主机，它的空间大小<br>
      及速度等都受到限制。如果您要使用全部的功能，<br>
      请您升级到正式的虚拟主机。</td>
  </tr>
<%end if%>
<%if haveopenemail then%>
    <tr bordercolor="#000000">
    <td height="60" bgcolor="#eeeeee"><font color="#000000"> 　　　 邮箱说明：</font></td>
    <td bgcolor="#eeeeee"><a href="/user/emailadm2.asp?id=<%=openemailid%>&go=e"><font color="#000000">您开通的主机产品附送有邮箱，您可以现在绑定邮箱域名>>>>>></font></a></td>
  </tr>
<%end if%>
<%if haveopensql then%>
    <tr bordercolor="#000000">
    <td height="60" bgcolor="#eeeeee"><font color="#000000"> 　　　 数据库说明：</font></td>
    <td bgcolor="#eeeeee"><a href="/user/sqladm.asp"><font color="#000000">您开通的主机产品附送有数据库>>>>>></font></a></td>
  </tr>
<%end if%>
  <tr bordercolor="#000000" bgcolor="#eeeeee">
    <td colspan="2"><font color="#000000">　　　</font><font color="#000000">　　　</font><font color="#000000">　</font><font color="#000000">　　　</font><font color="#000000">　　　</font><font color="#000000"> 　　　</font> 　</td>
  </tr>
  <tr align="center" bordercolor="#000000">
    <td height="34" colspan="2" bgcolor="#999999"> <font color="#990000">　我　们　为　您　提　供　优　质　的　服　务！</font></td>
  </tr>
</table>
<br>
<%=htmlwrite("html4")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
