<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
Dim CDNret

Function buildaclclosewrite(URL,FreeHostsharekey,var)
Set MaintoCSCom=Server.CreateObject("www.7i24.com")
body=URLEncoding("var="&var)
RetInfo=MaintoCSCom.DOHTTPSSL(Url&"?buildaclclosewrite",FreeHostsharekey,body,FreeHost_t1,FreeHost_t2,FreeHost_t3,FreeHost_t4)
Set MaintoCSCom =Nothing
buildaclclosewrite=RetInfo
End Function

server.ScriptTimeout =240
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf Request.Form ("username")="" Then
	ef=True
	ec="请输入用户名！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.Form ("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf Request.Form ("newusername")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("newusername")) Then
	ef=True
	ec="转移用户名中有非法字符！"
Elseif Request.Form ("Submit")="马上转移" and Request.Form ("newusername")="" then
	ef=True
	ec="请输入转移用户名！"
elseIf session("canadmhostset")="" Then

if Request.Form ("Submit")="马上转移" and session("canadmhostch")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

If Request.Form ("Submit")="主机管理" and session("canadmhostset")="" Then
	ef=True
	ec="您没有此操作的权限。"
end If

if (Request.Form ("Submit")="允许绑定子目录" or Request.Form ("Submit")="关闭绑定子目录绑定") and session("canadmhostmidsub")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

if Request.Form ("Submit")="更改允许的域名绑定数量" and session("canadmhostmiddomain")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

if (Request.Form ("Submit")="设置CDN流量" or Request.Form ("Submit")="将当前的CDN流量清0" Or Request.Form ("Submit")="设置流量及CPU" Or Request.Form ("Submit")="将当前的流量及CPU清0") and session("canadmhostmidcpu")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

if (Request.Form ("Submit")="单独设置续费价格" Or Request.Form ("Submit")="取消单独价格") and session("canadmhostmidrepay")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

if (Request.Form ("Submit")="马上升级" Or Request.Form ("Submit")="马上调整") and session("canmoneyA")="" Then
If IsNumeric (Request.Form ("usermoneyauto")) then
if (Request.Form ("usermoneyauto")<0 Or Request.Form ("usermoney")<0) then
	ef=True
	ec="您没有此操作的权限。您需要有财务操作的权限才能设置为负金额。"
End if
End If
If IsNumeric (Request.Form ("usermoney")) then
if (Request.Form ("usermoney")<0) then
	ef=True
	ec="您没有此操作的权限。您需要有财务操作的权限才能设置为负金额。"
End if
End If
end If

if (Request.Form ("Submit")="重设FTP密码" or Request.Form ("Submit")="回收池" or Request.Form ("Submit")="暂停"  or Request.Form ("Submit")="停止"  or Request.Form ("Submit")="恢复"  or Request.Form ("Submit")="临时恢复"  or Request.Form ("Submit")="提取日志"  or Request.Form ("Submit")="提取旧日志"  or Request.Form ("Submit")="启用详细出错信息"  or Request.Form ("Submit")="停止详细出错信息"  or Request.Form ("Submit")="设置拒绝IP"  or Request.Form ("Submit")="设置此目录只有htm权限"  or Request.Form ("Submit")="恢复此目录" or Request.Form ("Submit")="RAR还原" or Request.Form ("Submit")="RAR打包"  or Request.Form ("Submit")="关闭写入权限"  or Request.Form ("Submit")="恢复写入权限"  or Request.Form ("Submit")="马上重开此用户"  or Request.Form ("Submit")="停止这个主机的FTP读写权限"  or Request.Form ("Submit")="恢复这个主机的FTP读写权限"  or Request.Form ("Submit")="关闭此网站的FSO权限"  or Request.Form ("Submit")="打开此网站的FSO权限"  or Request.Form ("Submit")="允许查看日志/CPU"  or Request.Form ("Submit")="不允许查看日志/CPU"  or Request.Form ("Submit")="允许打包还原"  or Request.Form ("Submit")="不允许打包还原"  or Request.Form ("Submit")="允许备份还原"  or Request.Form ("Submit")="不允许备份还原"  or Request.Form ("Submit")="重新计算此用户的实际占用空间" or Request.Form ("Submit")="重新恢复此用户的权限结构" or Request.Form ("Submit")="更改主机的备注信息" or Request.Form ("Submit")="清空数据" or Request.Form ("Submit")="删除旧主机并更换服务器" )and session("canadmhostoth")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

If session("canadmhostmidcpu")="" Then
if Request.Form ("Submit")="设置资源"  then
	ef=True
	ec="您没有此操作的权限。"
end If
end If

if Request.Form ("dodel")="删除" and session("canadmhostdel")="" then
	ef=True
	ec="您没有此操作的权限。"
end If

ElseIf Instr(1, Request.Form ("htmdir"), "\", 1)>0 or Instr(1, Request.Form ("htmdir"), "..", 1)>0 then
	ef=True
	ec="只允许设一级目录，不要用\或..符号"
end If

if not ef then
If Request.Form ("pauseweb")="" Then 
if Request.Form ("Submit")="暂停" Then
	ef=True
	ec="请先选暂停原因!"
End if
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='"&Request.Form ("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		ds.Open Sql,conn,1,1
if ds.eof then
	ef=True
	ec="用户不存在!"
end if
end if

if not ef then
If Request.Form ("newusername")<>"" then
	Set dsNew = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&Request.Form ("newusername")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsNew.Open Sql,conn,1,1
if dsNew.eof then
	ef=True
	ec="要转移的用户不存在!"
end if
end if
end if

if not ef then
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&Request.Form ("id")&"'"
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="不存在的虚拟主机ID！"
end if
end If

if not ef then
isagentpd=False
If dsph ("hosttype")<>"子目录绑定" then
	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph ("Hosttype")&"'"
	dshost.Open Sql,conn,1,1
if dshost.Eof then
	ef=True
	ec="产品不存在！"
Else
isagentpd=dshost("isagentpd")
end If
End if
end If


if not ef Then
if isagentpd=false then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("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 Request.Form ("Submit")="马上调整" then
server.Transfer "handhost2endtime.asp"
end if
end If

if not ef then
if Request.Form ("Submit")="马上升级" then
server.Transfer "handhost2up.asp"
end if
end if

if not ef then

username=dsph("Ftpname")
if isagentpd=false then
FreeHostsharekey=dsserver("FreeHostsharekey")
URL=dsserver("site")
If Request.Form ("pauseweb")<>"" Then tourl=dsserver(""&Request.Form ("pauseweb")&"")
password=Request.Form ("password")
homedir=dsserver("homedir") 
IISID=dsph("IISID")
ostype=dsserver("ostype")'linux
End If
password=Request.Form ("password")
IISID=dsph("IISID")

'agent
if ds("agent1")<>"n" then
  Set dsagent = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_AGENT where username='"&ds("agent1")&"'"
		dsagent.Open Sql,conn,1,3
If not dsagent.Eof And Request.Form ("pauseweb")<>"" Then
if len(dsagent(""&Request.Form ("pauseweb")&""))>3 then
tourl=dsagent(""&Request.Form ("pauseweb")&"")
end if
end if
end if


%>

<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand" onClick="t1.style.display='';t2.style.display='';"><font color="#FFFFFF">主机管理</font></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF"><br>
 <DIV class="tableborder" id="t1"><table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif"><font color="#FFFFFF">数据库记录　　<a href="#"  onClick="t1.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="22" align="right" >编号：</td>
              <td width="80%" height="22" align="left" >　<%=dsph("id")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >FTP名：</td>
              <td width="80%" height="22" align="left" >　<%=dsph("ftpname")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >原FTP密码：</td>
              <td width="80%" height="22" align="left" bgcolor="#E4EAF2" >　<%=dsph("ftppassword")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >产品类型：</td>
              <td height="22" align="left" >　<%=dsph("Hosttype")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >域名：</td>
              <td height="22" align="left" ><%hostname=dsph("hostname")
If Not isnull(hostname) then
hostname=replace(hostname, ":80:","")
hostname_arry=Split(hostname, ",")
for idname=0 to ubound(hostname_arry)%>
                　<a href="http://<%=hostname_arry(idname)%>" target="_blank"><%=hostname_arry(idname)%></a><br>
                <%Next
End if                
				%> </td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >状态：</td>
              <td height="22" align="left" >　
                <%if dsph("endtime")>NOW then%>
                  <%if dsph("istest")="y" then%>
        试用
        <%else%>
        <%=dsph("status")%>
        <%end if%>
        <%else%>
        过期
        <%if dsph("status")="暂停" then%>
        并暂停
        <%end if%>
        <%end if%>
              </td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >开通时间：</td>
              <td height="22" align="left" >　<%=dsph("starttime")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >到期时间：</td>
              <td height="22" align="left" >　<%=dsph("endtime")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >所在服务器：</td>
              <td height="22" align="left" >　<%=dsph("ServerlistID")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >服务器IP： </td>
              <td height="22" align="left" >　
                <%
				if isagentpd=false then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
%>
                  <%=dsserver("ip")%> <%if Application("hostoneip")=true then
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where HostID="&dsph("id")
		dsX.Open Sql,conn,1,1
If not dsX.Eof Then%>　(独立分配IP:<%
while not dsX.eof
%><%=dsX("IP")%> <%
dsX.movenext
wend%>)<%end if
end If
End if%></td>
            </tr>
			<tr bgcolor="#E4EAF2">
              <td height="22" align="right" >备注信息： </td>
              <td height="22" align="left" >　
                <%=dsph("corewhat")%></td>
            </tr>
          </tbody>
        </table></div>
      <br>
<%if Request.Form ("Submit")<>"主机管理" then%>
 <DIV class="tableborder" id="t2"><table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">受控服务器上的记录　　<a href="#"  onClick="t2.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="70" align="right" >返回信息：</td>
              <td width="80%" height="22" align="left" >
<%
if Request.Form ("Submit")="停止这个主机的FTP读写权限" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
Response.Write FTPOP(URL,FreeHostsharekey,username,1)
end if
if Request.Form ("Submit")="恢复这个主机的FTP读写权限" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
Response.Write FTPOP(URL,FreeHostsharekey,username,0)
end if
%>
<%if Request.Form ("Submit")="暂停" or Request.Form ("Submit")="恢复" or Request.Form ("Submit")="停止" or Request.Form ("Submit")="临时恢复" then
if Request.Form ("Submit")="暂停" Then

pausereason=0
If Request.Form ("pauseweb")="pauseweb" Then pausereason=1
If Request.Form ("pauseweb")="pauseweb2" Then pausereason=2
If Request.Form ("pauseweb")="pauseweb3" Then pausereason=3
If Request.Form ("pauseweb")="pauseweb4" Then pausereason=4

op=1
if dsph("Hosttype")="子目录绑定" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
Response.Write PauseSiteSub(URL,FreeHostsharekey,IISID,tourl,op)
Else
Response.Write PauseSite(URL,FreeHostsharekey,username,tourl,op)
end if
dsph("status")="暂停"
dsph("pausebyagn")="a"
dsph("pausereason")=pausereason
dsph("pauseinfo")=request("pauseinfo")
dsph.update

'处理子目录绑定
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
IISID=dsphsub("IISID")
Response.Write PauseSiteSub(URL,FreeHostsharekey,IISID,tourl,op)
dsphsub("status")="暂停"
dsphsub("pausebyagn")="a"
dsphsub("pausereason")=pausereason
dsphsub("pauseinfo")=request("pauseinfo")
dsphsub.update
dsphsub.movenext
wend
dsphsub.close

end if

if Request.Form ("Submit")="停止" then
op=1
if dsph("Hosttype")="子目录绑定" then
Response.Write OPSiteSub(URL,FreeHostsharekey,IISID,op)
else
Response.Write OPSite(URL,FreeHostsharekey,username,op)
end if
dsph("status")="停止"
dsph("pausebyagn")="a"
dsph("pauseinfo")=request("pauseinfo")
dsph.update
'处理子目录绑定
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
IISID=dsphsub("IISID")
Response.Write OPSiteSub(URL,FreeHostsharekey,IISID,op)
dsphsub("status")="停止"
dsphsub("pausebyagn")="a"
dsphsub("pauseinfo")=request("pauseinfo")
dsphsub.update
dsphsub.movenext
wend
dsphsub.close
end if


if Request.Form ("Submit")="恢复" then
op=0
if dsph("Hosttype")="子目录绑定" then
Response.Write PauseSiteSub(URL,FreeHostsharekey,IISID,tourl,op)
Response.Write OPSiteSub(URL,FreeHostsharekey,IISID,op)
else
Response.Write PauseSite(URL,FreeHostsharekey,username,tourl,op)
if Not ostype="linux" Then Response.Write OPSite(URL,FreeHostsharekey,username,op)
if Not ostype="linux" Then Response.Write FTPOP(URL,FreeHostsharekey,username,0)
end if
dsph("status")="正常"
dsph("pausebyagn")="n"
dsph("pausereason")=0
dsph("pauseinfo")=request("pauseinfo")
dsph.update
'处理子目录绑定
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
IISID=dsphsub("IISID")
Response.Write PauseSiteSub(URL,FreeHostsharekey,IISID,tourl,op)
Response.Write OPSiteSub(URL,FreeHostsharekey,IISID,op)
dsphsub("status")="正常"
dsphsub("pausebyagn")="n"
dsphsub("pausereason")=0
dsphsub("pauseinfo")=request("pauseinfo")
dsphsub.update
dsphsub.movenext
wend
dsphsub.close
dsph.update
dsph.close
end if

if Request.Form ("Submit")="临时恢复" then
op=0
if dsph("Hosttype")="子目录绑定" then
Response.Write PauseSiteSub(URL,FreeHostsharekey,IISID,tourl,op)
Response.Write OPSiteSub(URL,FreeHostsharekey,IISID,op)
else
Response.Write PauseSite(URL,FreeHostsharekey,username,tourl,op)
Response.Write OPSite(URL,FreeHostsharekey,username,op)
end if
dsph("status")="暂停"
dsph("pausebyagn")="n"
dsph("pauseinfo")=request("pauseinfo")
dsph.update
'处理子目录绑定
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
IISID=dsphsub("IISID")
Response.Write PauseSiteSub(URL,FreeHostsharekey,IISID,tourl,op)
Response.Write OPSiteSub(URL,FreeHostsharekey,IISID,op)
dsphsub("status")="暂停"
dsphsub("pausebyagn")="n"
dsphsub("pauseinfo")=request("pauseinfo")
dsphsub.update
dsphsub.movenext
wend
dsphsub.close
dsph.update
dsph.close
Response.Write "<font color=red>请注意，临时恢复是此网站在数据库状态是暂停，但在服务器上是可以访问的。</font>"
end if

'暂停类处理完成
end if


if Request.Form ("Submit")="删除旧主机并更换服务器" Then


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


if dsph("Hosttype")="子目录绑定" then Response.Redirect "e.asp?e=子目录绑类不能换服务器，只能由主站更换。"


Set dsphemail = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where byhost='"&dsph ("id")&"'"
	dsphemail.Open Sql,conn,1,1
if not dsphemail.Eof then
%>
<br><a href="handemail1.asp?id=<%=dsphemail("id")%>" target="_blank"><font color=red>管理赠送的邮箱</font></a>
<%dsphemail.close
end if

Set dsphsql = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where byhost='"&dsph ("id")&"'"
	dsphsql.Open Sql,conn,1,1
if not dsphsql.Eof then
%>
<br><a href="handsql1.asp?id=<%=dsphsql("id")%>" target="_blank"><font color=red>管理赠送的数据库</font></a>
<%dsphsql.close
end if


ret=DelUser(URL,FreeHostsharekey,username)
'log
FreeHost_oplog session("admusername"),"信息","管理员换服务器删除旧"&username&"主虚拟主机: "&ret
Response.Write "<br>删除旧主机："&ret&"<br><br>"

'处理子目录绑定
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
IISID=dsphsub("IISID")
ret=DelUserSub(URL,FreeHostsharekey,IISID)
Response.Write ret
FreeHost_oplog session("admusername"),"信息","管理员换服务器删除旧"&username&"子目录虚拟主机: "&ret
dsphsub.delete
dsphsub.update
dsphsub.movenext
wend
dsphsub.close

dsph("ServerlistID")=Request.Form ("newServerlistID")
dsph.update
Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1

isuseCDN=dsserver("isuseCDN")	
usecdn1=dsserver("usecdn1")
usecdn2=dsserver("usecdn2")
usecdn3=dsserver("usecdn3")
usecdn4=dsserver("usecdn4")
usecdn5=dsserver("usecdn5")
CDNORIport=dsserver("port")

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
End if

'重开
	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	dshost.Open Sql,conn,1,1
packagename=dshost("packagename")'linux
hostip=dsserver("ip")

'调用开通function
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 Not IsNull(dsph("netver")) Then netver=dsph("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") 
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")'linux
hostip=dsserver("ip")
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=Replace(hostcomment_arry(0),":80:","")&"_"&username&"_"&dsph ("username")
MaxConnections=dshost ("MaxConnections")
EnumAppsInPool=dshost ("AppPoolnum")
MaxBandwidth=dshost ("MaxBandwidth")
'DefaultDoc=""'dshost ("DefaultDoc")
ScriptMaps=ScriptMaps
AccessFlags=AccessFlags
'LogFileDirectory=""'dsserver ("LogFileDirectory")
'HttpErrors=""'Request.Form ("HttpErrors")

if not isnull(dsph("spacelimt")) then  spacelimit=dsph("spacelimt")
if not isnull(dsph("MaxConnections")) then  MaxConnections=dsph("MaxConnections")
if not isnull(dsph("MaxBandwidth")) then  MaxBandwidth=dsph("MaxBandwidth")
if not isnull(dsph("AppPoolnum")) then  EnumAppsInPool=dsph("AppPoolnum")

if isuseCDN=true Then host=Replace(host,":80:",":"&CDNORIport&":")
Application.lock
Application("hostoptime")=now
Application("hostoplock")=true
Application.unlock


If Not IsNull(dsph("CurPoolname")) Then
siteID=dsph("id")&"000"
outpoolname=dsph("CurPoolname")
op=1
temp="新受控"&AddUser3(URL,FreeHostsharekey,username,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,username,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

response.write temp
if not instr(temp,"成功")>1 And Not InStr(temp,"created successfully")>1 then
response.write "出现错误："
response.write "<br><br>开通新主机："&temp
Response.end
else
	dsph("status")="正常"
	dsph.Update
end if
dsph.close

CDNrefreshDomain'更新CDN
response.write CDNret

%>
操作成功，用户网站已在新服务器上开通了。请通知用户重新上传用户。如果有绑定子目录，子目录需要重新绑定。
<%end if'换服务器


if Request.Form ("Submit")="清空数据" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
username=dsph ("Ftpname")
dirname="\web\"&Request.Form ("dirname")

If RegExpTest("[^A-Za-z0-9]",replace(Request.Form ("dirname"),"\","")) or trim(Request.Form ("dirname"))="" Then
Response.Write " 目录名不能有特殊字符，也不能为空。只能清空web目录下的子目录。"
Response.end
end if

returnstr =  CleanWeb(URL,FreeHostsharekey,username,dirname)
if (instr(1,returnstr,"NOT IMPLEMENTED")>0) then 
Response.Write "请先升级受控端" 
Response.End 
end if 
Response.Write returnstr&" 如果执行后还是无法删除，请停止网站后回收池，再试一次。"
end if

if Request.Form ("Submit")="重新计算此用户的实际占用空间" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
username=dsph ("Ftpname")
homedir=dsserver("homedir")
homedir=replace(homedir&"\"&username,"\\","\")
rbsone=" -r -v "&username&" "&homedir&"\"&"*.*"
rbsvar=replace(rbsone,"\\","")
returnstr =  RBS2(URL,FreeHostsharekey,rbsvar)
if (instr(1,returnstr,"NOT IMPLEMENTED")>0) then 
Response.Write "请先升级受控端" 
Response.End 
end if 
Response.Write returnstr&" 5分钟后开始执行。"
end if

if Request.Form ("Submit")="单独设置续费价格" and Request.Form ("repaymoney")<>"" then
if IsNumeric(Request.Form ("repaymoney")) and Request.Form ("repaymoney")>0 then
dsph ("repaymoney")=Request.Form ("repaymoney")
dsph.update
Response.Write "此产品的续费价格已单独更新为："&Request.Form ("repaymoney")&"元"
else
Response.Write "请输入大于0的价格。"
end if 
end If

if Request.Form ("Submit")="取消单独价格" then
dsph ("repaymoney")=null
dsph.update
Response.Write "此产品的续费价格已恢复为默认价格"
end if

if Request.Form ("Submit")="重新恢复此用户的权限结构" or Request.Form ("Submit")="恢复写入权限" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
username=dsph ("Ftpname")
homedir=dsserver("homedir")
homedir=replace(homedir&"\"&username,"\\","\")
rbsone=username&" "&homedir
rbsvar=replace(rbsone,"\\","")
returnstr =  BUILDACL(URL,FreeHostsharekey,rbsvar)
if (instr(1,returnstr,"NOT IMPLEMENTED")>0) then 
Response.Write "请先升级受控端" 
Response.End 
end if 
Response.Write returnstr&" 3分钟后开始执行。"
end if

if Request.Form ("Submit")="单独设置续费价格" and Request.Form ("repaymoney")<>"" then
if IsNumeric(Request.Form ("repaymoney")) and Request.Form ("repaymoney")>0 then
dsph ("repaymoney")=Request.Form ("repaymoney")
dsph.update
Response.Write "此产品的续费价格已单独更新为："&Request.Form ("repaymoney")&"元"
else
Response.Write "请输入大于0的价格。"
end if 
end If

if Request.Form ("Submit")="更改允许的域名绑定数量" and IsNumeric(Request.Form ("domaincount")) Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
if Request.Form ("domaincount")>0 then
dsph ("domaincount")=Request.Form ("domaincount")
dsph.update
Response.Write "此产品的允许绑定域名数量单独更新为："&Request.Form ("domaincount")&"个"
else
Response.Write "请输入大于0的数量。"
end if 
end If


if Request.Form ("Submit")="更改主机的备注信息" then
dsph ("corewhat")=Request.Form ("corewhat")
dsph.update
Response.Write "此产品的备注信息已更新为："&Request.Form ("corewhat")
end if

if Request.Form ("Submit")="回收池" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
returnstr = ShowUser2(URL,FreeHostsharekey,username)
if (instr(1,returnstr,"用户不存在！")>0) then 
Response.Write returnstr
Response.End 
end if 
PoolName=GETvalue(returnstr,",;应用程序池名：",";默认首页：")
PoolName=trim(PoolName)
Response.Write POOLOP(URL,FreeHostsharekey,poolname)
end if

if Request.Form ("Submit")="关闭此网站的FSO权限" or Request.Form ("Submit")="打开此网站的FSO权限" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
returnstr = ShowUser2(URL,FreeHostsharekey,username)
if (instr(1,returnstr,"用户不存在！")>0) then 
Response.Write returnstr
Response.End 
end if 
PoolName=GETvalue(returnstr,",;应用程序池名：",";默认首页：")
PoolName=trim(PoolName)
if instr(PoolName,"1_")>0 then
if Request.Form ("Submit")="关闭此网站的FSO权限" then
op=1
Response.Write FSOOP(URL,FreeHostsharekey,username,op)
end if
if Request.Form ("Submit")="打开此网站的FSO权限" then
op=0
Response.Write FSOOP(URL,FreeHostsharekey,username,op)
end if
Response.Write POOLOP(URL,FreeHostsharekey,poolname)
else
Response.Write "很抱歉，这个网池所在的池不允许执行此项操作。一个网站一个池的情况下，才允许使用此功能。"
end if
end if

if Request.Form ("Submit")="启用日志" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=1
LogFileDirectory=replace(homedir&"\"&username&"\log","\\","\")
if dsph("Hosttype")="子目录绑定" then
Response.Write OPLOGSub(URL,FreeHostsharekey,username,IISID,LogFileDirectory,op)
else
Response.Write OPLOG(URL,FreeHostsharekey,username,LogFileDirectory,op)
end if
end if

if Request.Form ("Submit")="提取日志" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=1
LogFileDirectory=replace(homedir&"\"&username&"\log","\\","\")
'if dsph("Hosttype")="子目录绑定" then
'Response.Write OPLOGSub(URL,FreeHostsharekey,username,IISID,LogFileDirectory,op)
'else
'Response.Write OPLOG(URL,FreeHostsharekey,username,LogFileDirectory,op)
'end if
dsph ("getmelog")="y"
dsph.update
dsph.close

%>　今天的日志文件将在明天早上6:00后复制到您的log目录中。请您留意下载，日志文件只会保留一天。<%
end if

if Request.Form ("Submit")="提取旧日志" then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
Response.Write MakeLOG(URL,FreeHostsharekey,username,Request.Form ("oldday"))

dsph.update
dsph.close

%>　两分钟后开始提取到用户的/log目录中。<%
end if


if Request.Form ("Submit")="停止日志" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=0
LogFileDirectory=replace(homedir&"\"&username&"\log","\\","\")
if dsph("Hosttype")="子目录绑定" then
Response.Write OPLOGSub(URL,FreeHostsharekey,username,IISID,LogFileDirectory,op)
else
Response.Write OPLOG(URL,FreeHostsharekey,username,LogFileDirectory,op)
end if
end if

if Request.Form ("Submit")="启用详细出错信息" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=1
if dsph("Hosttype")="子目录绑定" then
Response.Write OPASPERRSub(URL,FreeHostsharekey,IISID,op)
else
Response.Write OPASPERR(URL,FreeHostsharekey,username,op)
end if
end if

if Request.Form ("Submit")="停止详细出错信息" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=0
if dsph("Hosttype")="子目录绑定" then
Response.Write OPASPERRSub(URL,FreeHostsharekey,IISID,op)
else
Response.Write OPASPERR(URL,FreeHostsharekey,username,op)
end if
end if

if Request.Form ("Submit")="设置拒绝IP" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
if dsph("Hosttype")="子目录绑定" then
Response.Write DenySiteIP(URL,FreeHostsharekey,username,Request.Form ("IPARRY"))
else
Response.Write DenySiteIP(URL,FreeHostsharekey,username,Request.Form ("IPARRY"))
end if
end if

if Request.Form ("Submit")="设置此目录只有htm权限" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=1
if dsph("Hosttype")="子目录绑定" then
htmdir=replace(homedir&"\"&username&"\web\"&dsph("dirname")&"\"&Request.Form ("htmdir"),"\\","\")
htmdir2=replace(Request.Form ("htmdir"),"\\","\")
Response.Write OPHTMDIRSub(URL,FreeHostsharekey,IISID,htmdir,htmdir2,op)
else
htmdir=replace(Request.Form ("htmdir"),"\\","\")
Response.Write OPHTMDIR(URL,FreeHostsharekey,username,htmdir,op)
end if
end if

if Request.Form ("Submit")="恢复此目录" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
op=0
if dsph("Hosttype")="子目录绑定" then
htmdir=replace(homedir&"\"&username&"\web\"&dsph("dirname")&"\"&Request.Form ("htmdir"),"\\","\")
htmdir2=replace(Request.Form ("htmdir"),"\\","\")
Response.Write OPHTMDIRSub(URL,FreeHostsharekey,IISID,htmdir,htmdir2,op)
else
htmdir=replace(Request.Form ("htmdir"),"\\","\")
Response.Write OPHTMDIR(URL,FreeHostsharekey,username,htmdir,op)
end if
end If


if Request.Form ("Submit")="RAR打包" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
If Request.Form ("rardirname")="" Then
Response.Write "目录名不能为空"
Response.end
End if
	yy=year(date)
	mm=right("00"&month(date),2)
	dd=right("00"&day(date),2)
	v_ymd=yy&mm&dd
	xiaoshi=right("00"&hour(time),2)
	fenzhong=right("00"&minute(time),2)
	miao=right("00"&second(time),2)
	BillNo=v_ymd&xiaoshi&fenzhong&miao

pathRAR=replace(homedir&"\"&username&"\db\"&BillNo&".rar","\\","\")
pathDIR=replace(homedir&"\"&username&"\"&Request.Form ("rardirname")&"\*.*","\\","\")

RARcon=" a -ibck -inul -m0 -ep1 -r -y "&pathRAR&" "&pathDIR
if Request.Form ("rarv")="y" then RARcon=" a -v50M -ibck -inul -m0 -ep1 -r -y "&pathRAR&" "&pathDIR
toDIR=replace(homedir&"\"&username&"\","\\","\")
rbsvar="-r -v "&username&" "&toDIR&"*.*"
Response.Write RAROPadm(URL,FreeHostsharekey,RARcon)
Response.Write RBSop(URL,FreeHostsharekey,rbsvar)
%>　系统会在十分钟后自动将<%=Request.Form ("rardirname")%>目录打包在db目录的<%=BillNo&".rar"%>文件中，请您稍后用FTP下载它。
<%end If


if Request.Form ("Submit")="RAR还原" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
If Request.Form ("rarname")="" Then
Response.Write "RAR文件名不能为空"
Response.end
End if
	BillNo=replace(Request.Form ("rarname"),".rar","")

pathRAR=replace(homedir&"\"&username&"\db\"&BillNo&".rar","\\","\")
pathDIR=replace(homedir&"\"&username&"\"&Request.Form ("rardirname")&"\","\\","\")
RARcon=" x -ibck -inul -y "&pathRAR&" "&pathDIR

'Response.Write RAROP(URL,FreeHostsharekey,RARcon,username,password)

toDIR=replace(homedir&"\"&username&"\","\\","\")
'RARcon=" x -ibck -inul -y "&frompath&" "&toDIR
rbsvar="-r -v "&username&" "&toDIR&"*.*"

'Response.Write RARcon

Response.Write RAROPadm(URL,FreeHostsharekey,RARcon)
Response.Write RBSop(URL,FreeHostsharekey,rbsvar)


%>　系统将会在十分钟后，自动将<%=BillNo&".rar"%>解压缩到<%=Request.Form ("rardirname")%>目录中，您可以稍后用FTP工具的移动功能来进一步调整目录结构。如果您没有看到成功解压缩的文件，请检查原始的RAR文件是否存在、文件名是否确、您的空间是否用完。
<%end if


if Request.Form ("Submit")="关闭写入权限" Then
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"
opdir=replace(Request.Form ("opdir"),"\\","\")
if dsph("Hosttype")="子目录绑定" then
response.write "子目录绑定类网站此功能受主网站控制。"
else
username=dsph ("Ftpname")
homedir=dsserver("homedir")
homedir=homedir&"\"&username
homedir=homedir&"\web"
if opdir<>"" then homedir=homedir&"\"&opdir
homedir=replace(homedir,"\\","\")
rbsone=username&" "&homedir
var=replace(rbsone,"\\","\")
Response.Write buildaclclosewrite(URL,FreeHostsharekey,var)
response.write "命令在五分钟后开始执行。"
end if
end if

if Request.Form ("dodel")="删除" then

'if Application("hostoneip")=true Then
Sql="update FreeHost.FreeHost_Product_Host_IP set HOSTID=0 where hostid='"&dsph("id")&"'"
conn.Execute Sql
'End if

if dsph("Hosttype")="子目录绑定" then
'查找资源
isnotdesign=false
if dsph("useper")=0 then '未分配资源的站
isnotdesign=true
end if

dsph.delete
dsph.Update
Response.Write "站点信息已从数据库中删除。"
'if not ef then
ALLMaxConnections=0
ALLMaxBandwidth=0

returnstr=ShowUserSub(URL,FreeHostsharekey,IISID)
if instr(1,returnstr,"用户不存在！")>0 or instr(1,returnstr,"出错！")>0 then 
Response.Write returnstr
Response.End 
end If
if Not instr(returnstr,"网站名")>1 then 
Response.Write "这台受控服务器自检没有通过，请在站点管理，虚拟主机中自检来分析原因。完整的返回信息是:<br><br>"&returnstr
Response.End 
end if 

ALLMaxConnectionsA=GETvalue(returnstr,";IIS连接数：",";带宽限制：")
ALLMaxBandwidthA=GETvalue(returnstr,";带宽限制：",";主机头名：")
if ALLMaxConnectionsA="-1" or ALLMaxConnectionsA="4294967295"  or ALLMaxConnections=-1 then
ALLMaxConnections=-1
else
ALLMaxConnections=ALLMaxConnections+ALLMaxConnectionsA
end if
if ALLMaxBandwidthA="4294967295" or ALLMaxBandwidthA="-1" or ALLMaxBandwidth=4294967295 then
ALLMaxBandwidth=4294967295
else
ALLMaxBandwidth=ALLMaxBandwidth+ALLMaxBandwidthA
end if

returnstr = ShowUser2(URL,FreeHostsharekey,username)
if instr(1,returnstr,"用户不存在！")>0 or instr(1,returnstr,"出错！")>0 then 
Response.Write returnstr
Response.End 
end if
ALLMaxConnectionsA=GETvalue(returnstr,";IIS连接数：",";带宽限制：")
ALLMaxBandwidthA=GETvalue(returnstr,";带宽限制：",";主机头名：")
if ALLMaxConnectionsA="-1" or ALLMaxConnectionsA="4294967295"  or ALLMaxConnections=-1 then
ALLMaxConnections=-1
else
ALLMaxConnections=ALLMaxConnections+ALLMaxConnectionsA
end if
if ALLMaxBandwidthA="4294967295" or ALLMaxBandwidthA="-1" or ALLMaxBandwidth=4294967295 then
ALLMaxBandwidth=4294967295
else
ALLMaxBandwidth=ALLMaxBandwidth+ALLMaxBandwidthA
end if

'end if

'Response.Write ALLMaxConnections&"<br>"
'Response.Write ALLMaxBandwidth&"<br>"
ret=DelUserSub(URL,FreeHostsharekey,IISID)
Response.write ret
FreeHost_oplog session("admusername"),"信息","管理员删除"&username&"子目录虚拟主机: "&ret

if isnotdesign=false then '未分配资源的站
MaxConnections=ALLMaxConnections
MaxBandwidth=ALLMaxBandwidth
temp2=ModifyUser2(URL,FreeHostsharekey,username,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
Response.Write temp
end if
'完成资源分配


Else


Set dsphemail = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where byhost='"&dsph ("id")&"'"
	dsphemail.Open Sql,conn,1,1
if not dsphemail.Eof then
%>
<br><a href="handemail1.asp?id=<%=dsphemail("id")%>" target="_blank"><font color=red>管理赠送的邮箱</font></a>
<%dsphemail.close
end if

Set dsphsql = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where byhost='"&dsph ("id")&"'"
	dsphsql.Open Sql,conn,1,1
if not dsphsql.Eof then
%>
<br><a href="handsql1.asp?id=<%=dsphsql("id")%>" target="_blank"><font color=red>管理赠送的数据库</font></a>
<%dsphsql.close
end if

Set dsdom = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Domain where byid='"&dsph ("id")&"'"
	dsdom.Open Sql,conn,1,1
if not dsdom.Eof then
%>
<br><a href="listmydomain.asp?id=<%=dsdom("id")%>" target="_blank"><font color=red>管理赠送的域名</font></a>
<%
dsdom.close
end if

Set dspre = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Preopen_Product where byid='"&dsph ("id")&"'"
	dspre.Open Sql,conn,1,3
if not dspre.Eof then%>
<br><font color=red>赠送的未开通的域名已删除</font></a>
<%
dspre.delete
dspre.movenext
end if
dspre.close

On Error Resume next'出错也处理
'Response.end
ret=DelUser(URL,FreeHostsharekey,username)
'log
FreeHost_oplog session("admusername"),"信息","管理员删除"&username&"主虚拟主机: "&ret
Response.Write ret&"<br>"

'删除ICPDB
conn.Execute "delete from FreeHost.FreeHost_ICPDB where ftpname='"&dsph("ftpname")&"'"

'处理子目录绑定
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
IISID=dsphsub("IISID")
ret=DelUserSub(URL,FreeHostsharekey,IISID)
Response.Write ret
FreeHost_oplog session("admusername"),"信息","管理员删除"&username&"子目录虚拟主机: "&ret
dsphsub.delete
dsphsub.update
dsphsub.movenext
wend
dsphsub.close

dsph.delete
dsph.close
end if
end if

if Request.Form ("Submit")="重设FTP密码" Then
if password="" Then
response.write "密码不能为空!"
response.End
End if
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置FTP密码，请在主站中设置"
else
Response.Write ResetPassword(URL,FreeHostsharekey,username,password)
dsph("Ftppassword")=password
response.write "新密码："&password
dsph.update
dsph.close

	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&Request.Form ("id")&"'"
	dsph.Open Sql,conn,1,3
while not dsph.Eof
IISID=dsph("IISID")
homedir=""
temp=ModifyUserSub(URL,FreeHostsharekey,username,password,IISID,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
response.write temp
dsph("Ftppassword")=password
dsph.update
dsph.movenext
wend
dsph.close
end if
end if


if Request.Form ("Submit")="允许绑定子目录" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能再允许再绑定"
else
dsph("allowsub")="y"
dsph("subweb")=Request.Form ("subweb")
response.write "允许绑定子目录："&Request.Form ("subweb")&"　个"
dsph.update
dsph.close
end if
end if

if Request.Form ("Submit")="允许查看日志/CPU" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canseelog")="y"
response.write "允许此虚拟主机查看日志/CPU。"
dsph.update
dsph.close
end if
end if
if Request.Form ("Submit")="不允许查看日志/CPU" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canseelog")="n"
response.write "不允许此虚拟主机查看日志/CPU。"
dsph.update
dsph.close
end if
end if

if Request.Form ("Submit")="允许打包还原" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canrar")="y"
response.write "允许此虚拟主机打包还原。"
dsph.update
dsph.close
end if
end if
if Request.Form ("Submit")="不允许打包还原" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canrar")="n"
response.write "不允许此虚拟主机打包还原。"
dsph.update
dsph.close
end if
end If


if Request.Form ("Submit")="允许回收池" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canrecypool")="y"
response.write "允许回收池。"
dsph.update
dsph.close
end if
end if
if Request.Form ("Submit")="不允许回收池" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canrecypool")="n"
response.write "不允许回收池。"
dsph.update
dsph.close
end if
end If

if Request.Form ("Submit")="允许用户自己切换.Net版本" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canchnetver")="y"
response.write "允许用户自己切换.Net版本,设置成功."
dsph.update
dsph.close
end if
end if
if Request.Form ("Submit")="不允许用户自己切换.Net版本" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canchnetver")="n"
response.write "不允许用户自己切换.Net版本,设置成功."
dsph.update
dsph.close
end if
end If

if Request.Form ("Submit")="切换成1.1版本" or Request.Form ("Submit")="切换成2.0/3.5版本"  or Request.Form ("Submit")="切换成4.0版本" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
Else
	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	dshost.Open Sql,conn,1,1
if dshost("aspx")<>"y" Then
response.write "不支持asp.net的虚拟主机不能用这个功能"
response.end
End if

If Request.Form ("Submit")="切换成1.1版本" then
dsph("netver")="1.1"
Else
dsph("netver")="2.0"
End If
If Request.Form ("Submit")="切换成4.0版本" Then dsph("netver")="4.0"
dsph.update
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 Not IsNull(dsph("netver")) Then netver=dsph("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") 
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 dsph("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,"||","|"))

EnumAppsInPool=dshost ("AppPoolnum")
netver=dsserver("netver")

if not isnull(dsph("AppPoolnum")) Then
If dsph("AppPoolnum")=1 then
EnumAppsInPool=1
End if
End if

If Not IsNull(dshost("netver")) Then netver=dshost("netver")
If netver<>dsph("netver") then'当产品默认.net不等于要换的
If EnumAppsInPool>1 then
If dsph("netver")="1.1" Then EnumAppsInPool=EnumAppsInPool+1
If dsph("netver")="2.0" Then EnumAppsInPool=EnumAppsInPool+2
If dsph("netver")="4.0" Then EnumAppsInPool=EnumAppsInPool+4
dsph("AppPoolnum")=EnumAppsInPool
dsph.update
End if
End If
homedir=""
'temp=ModifyUser2(URL,FreeHostsharekey,username,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)

dsph("AppPoolnum")=EnumAppsInPool'不保存的
'If Not IsNull(dsph("CurPoolname")) Then
'dsph("CurPoolname")=Null
'dsph.update
'新的受控
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'不保存

if EnumAppsInPool=1 then  EnumAppsInPool=""

outpoolname=dsph("CurPoolname")
op=1
outtemp="新受控"&ModifyUser3(URL,FreeHostsharekey,username,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth,outpoolname,op)

response.write outtemp&"<br>"
'处理子目录绑定
if dsph("Hosttype")<>"子目录绑定" then
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
dsphsub("netver")=dsph("netver")
IISID=dsphsub("IISID")
temp="子目录站同步操作："&ModifyUserSub(URL,FreeHostsharekey,username,password,IISID,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
response.write temp
dsphsub.update
dsphsub.movenext
wend
dsphsub.close
end if
End If
End if

if Request.Form ("Submit")="允许下载类文件" Or Request.Form ("Submit")="不允许下载类文件" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
Else
if Request.Form ("Submit")="允许下载类文件" then
dsph("notuserar")="n"
response.write "允许下载类文件.处理结果:"
else
dsph("notuserar")="y"
response.write "不允许下载类文件.处理结果:"
End If
dsph.update
	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	dshost.Open Sql,conn,1,1
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 Not IsNull(dsph("netver")) Then netver=dsph("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") 
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 dsph("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,"||","|"))

EnumAppsInPool=dshost ("AppPoolnum")
if not isnull(dsph("AppPoolnum")) then  EnumAppsInPool=dsph("AppPoolnum")

'response.write ScriptMaps

homedir=""
temp=ModifyUser2(URL,FreeHostsharekey,username,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
response.write temp&"<br>"
'处理子目录绑定
if dsph("Hosttype")<>"子目录绑定" then
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
dsphsub("netver")=dsph("netver")
IISID=dsphsub("IISID")
temp="子目录站同步操作："&ModifyUserSub(URL,FreeHostsharekey,username,password,IISID,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
response.write temp
dsphsub.update
dsphsub.movenext
wend
dsphsub.close
end if

dsph.update
dsph.close
end if
end if

if Request.Form ("Submit")="允许备份还原" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canback")="y"
response.write "允许此虚拟主机允许备份还原。"
dsph.update
dsph.close
end if
end if
if Request.Form ("Submit")="不允许备份还原" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置此项"
else
dsph("canback")="n"
response.write "不允许此虚拟主机允许备份还原。"
dsph.update
dsph.close
end if
end if


if Request.Form ("Submit")="设置CDN流量" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置，只能设置主站。"
else
dsph("CDNMaxMb")=Request.Form ("CDNMaxMb")
response.write "流量限制设置为："&Request.Form ("CDNMaxMb")&" M/月<br>"
dsph.update
dsph.close
end if
end If

if Request.Form ("Submit")="将当前的CDN流量清0" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置，只能设置主站。"
else
dsph("CDNMBthismonth")=0
response.write "CDN本月已用流量已清0<br>"
dsph.update
dsph.close
end if
end If


if Request.Form ("Submit")="设置流量及CPU" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置，只能设置主站。"
else
dsph("Maxbytes")=CDbl(Request.Form ("Maxbytes")*1024*1024)
dsph("MaxCPU")=CDbl(Request.Form ("MaxCPU")*8640000*5)
response.write "流量限制设置为："&Request.Form ("Maxbytes")&" M/月<br>"
response.write "CPU限制设置为："&Request.Form ("MaxCPU")&" %<br>"
dsph.update
dsph.close
end if
end If

if Request.Form ("Submit")="将当前的流量及CPU清0" then
if dsph("Hosttype")="子目录绑定" then
response.write "本身是子目录绑定类主机不能设置，只能设置主站。"
else
Set dsphsub = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&dsph("id")&"' and allowsub='n' and ftpname='"&dsph("ftpname")&"'"
	dsphsub.Open Sql,conn,1,3
while not dsphsub.eof
dsphsub("thismonbytes")=0
dsphsub("TimeTaken")=0
dsphsub("BytesReceived")=0
dsphsub("BytesSent")=0
dsphsub("cpuALL")=0
dsphsub.movenext
wend

dsph("oldmonthbytes")=0
dsph("thismonbytes")=0
dsph("thismonbytesALL")=0
dsph("BytesReceived")=0
dsph("BytesSent")=0
dsph("TimeTaken")=0
dsph("cpuALL")=0
response.write "流量及CPU已清0<br>"
dsph.update
dsph.close
end if
end if

if Request.Form ("Submit")="关闭绑定子目录绑定" then
dsph("allowsub")="n"
dsph("subweb")=0
response.write "已设置不允许绑定子目录"
dsph.update
dsph.close
end if

if Request.Form ("Submit")="马上重开此用户" then
if dsph("Hosttype")="子目录绑定" then
Set dsphmain = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&dsph("allowsubbyid")&"'"
	dsphmain.Open Sql,conn,1,1

	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsphmain("Hosttype")&"'"
	dshost.Open Sql,conn,1,1
'调用开通function
packagename=dshost("packagename")'linux
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 Not IsNull(dsph("netver")) Then netver=dsph("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") 
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")
hostip=dsserver("ip")
username=dsph ("Ftpname")
Ftpname=dsph ("Ftpname")
password=dsph("Ftppassword")
comment=dsph ("username")
homedir=dsserver("homedir")
spacelimit=dshost ("spacelimt")
starttime=dsph("starttime")
endtime=dsph("endtime")
type1=dsph("Hosttype")
email="子目录绑定"
host=dsph("hostname")
hostcomment_arry=Split(host, ",")
hostcomment="Sub_"&username&"_"&Replace(hostcomment_arry(0),":80:","")&"_"&dsph ("username")
MaxConnections=10'----------------------
EnumAppsInPool=50'----------------------

'DefaultDoc=""'dshost ("DefaultDoc")
ScriptMaps=ScriptMaps
AccessFlags=AccessFlags
MaxBandwidth=1024'----------------------

hostname=host
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)
End If
host=hostname

if Application("hostoneip")=true then
Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where HostID="&dsph("id")
		dsX.Open Sql,conn,1,1
If not dsX.Eof Then
host=Replace(host,":80:",dsX("IP")&":80:")
If dsph("iphead")=true then host=dsX("IP")&":80:"&dsX("IP")&","&host
If dsph("nullhead")=true Then host=dsX("IP")&":80:,"&host
End if
End if

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

Application.lock
temp=AddUserSub(URL,FreeHostsharekey,username,password,comment,homedir,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)
Application.unlock
FreeHost_oplog dsph("username"),"信息","管理员恢复子目录虚拟主机: "&temp
if instr(temp,"出错")>0 then
Response.Redirect "e.asp?e="&temp
end if

Response.write temp

IISID=GETvalue(temp,"此目录的虚拟主机ID为：_","_号;")
NOWIISID=IISID
	dsph("status")="正常"
	dsph("IISID")=IISID
	dsph.Update

else
	Set dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	dshost.Open Sql,conn,1,1

packagename=dshost("packagename")'linux

'调用开通function
AccessFlags=1
if dshost("asp")="y" then
AccessFlags=513
ScriptMaps=dsserver("asp") 
end if
if dshost("aspx")="y" then
AccessFlags=513
ScriptMaps=ScriptMaps&"|"&dsserver("aspx") 
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")'linux
hostip=dsserver("ip")
username=dsph ("Ftpname")
Ftpname=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=Replace(hostcomment_arry(0),":80:","")&"_"&username&"_"&dsph ("username")
MaxConnections=dshost ("MaxConnections")
EnumAppsInPool=dshost ("AppPoolnum")
MaxBandwidth=dshost ("MaxBandwidth")
'DefaultDoc=""'dshost ("DefaultDoc")
ScriptMaps=ScriptMaps
AccessFlags=AccessFlags
'LogFileDirectory=""'dsserver ("LogFileDirectory")
'HttpErrors=""'Request.Form ("HttpErrors")

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

If 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

response.write "出现错误：此主机必须删除重开！!"
'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

response.write temp
if not instr(temp,"成功")>1 then
response.write "出现错误："
response.write temp
Response.end
else
	dsph("status")="正常"
	dsph.Update
end if
dsph.close
end if
end if











if Request.Form ("Submit")="马上转移" Then

FreeHost_oplog session("admusername"),"信息","管理员转移"&dsph ("username")&"虚拟主机FTP名("&dsph ("Ftpname")&") 给"&Request.Form ("newusername")

'变更邮箱
Set dsphemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Email where byhost='"&dsph ("id")&"'"
	dsphemail.Open Sql,conn,1,3
if not dsphemail.Eof then
dsphemail("username")=Request.Form ("newusername")
response.write "赠送的邮箱产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
dsphemail("agent1")=dsNEW("agent1")
if dsphemail("agent1")<>"n" then
response.write "赠送的邮箱产品已转移到代理："&dsphemail("agent1")&" 名下。<br>"
end If

Set dspdallemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLEmail where PdEID='"&dsphemail ("id")&"' order by emailname"
		dspdallemail.Open Sql,conn,1,3
		while not dspdallemail.eof
response.write "域管理员："&dspdallemail("emailname")&" 转到"&Request.Form ("newusername")&" 名下。<br>"
dspdallemail("username")=Request.Form ("newusername")
dspdallemail.update
dspdallemail.movenext
		wend

dsphemail.update
dsphemail.close
end if
'变更SQL
Set dsphemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Sql where byhost='"&dsph ("id")&"'"
	dsphemail.Open Sql,conn,1,3
while Not dsphemail.Eof
dsphemail("username")=Request.Form ("newusername")
response.write "赠送的SQL产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
dsphemail("agent1")=dsNEW("agent1")
if dsphemail("agent1")<>"n" then
response.write "赠送的SQL产品已转移到代理："&dsphemail("agent1")&" 名下。<br>"
end if
dsphemail.update
dsphemail.movenext
Wend
dsphemail.close
'变更域名
Set dsphemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Domain where byid='"&dsph ("id")&"'"
	dsphemail.Open Sql,conn,1,3
if not dsphemail.Eof then
dsphemail("username")=Request.Form ("newusername")
response.write "赠送的域名产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
dsphemail("agent1")=dsNEW("agent1")
if dsphemail("agent1")<>"n" then
response.write "赠送的域名产品已转移到代理："&dsphemail("agent1")&" 名下。<br>"
end if
dsphemail.update
dsphemail.close
end if
'变更域名PRE
Set dsphemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Preopen_Product where byid='"&dsph ("id")&"'"
	dsphemail.Open Sql,conn,1,3
if not dsphemail.Eof then
dsphemail("username")=Request.Form ("newusername")
response.write "赠送的域名产品(未开通)已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
dsphemail("agent1")=dsNEW("agent1")
if dsphemail("agent1")<>"n" then
response.write "赠送的域名产品(未开通)已转移到代理："&dsphemail("agent1")&" 名下。<br>"
end if
dsphemail.update
dsphemail.close
end if
dsph("username")=Request.Form ("newusername")
response.write "产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
'if Request.Form ("changeagn")="y" then
dsph("agent1")=dsNEW("agent1")
if dsph("agent1")<>"n" then
response.write "产品已转移到代理："&dsph("agent1")&" 名下。<br>"
end if

'end if
dsph.update
dsph.close
'子目录
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where allowsubbyid='"&Request.Form ("id")&"'"
	dsph.Open Sql,conn,1,3
while not dsph.Eof
dsph("username")=Request.Form ("newusername")
response.write "产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
'if Request.Form ("changeagn")="y" then
dsph("agent1")=dsNEW("agent1")
if dsph("agent1")<>"n" then
response.write "产品已转移到代理："&dsph("agent1")&" 名下。<br>"
end if
dsph.update
dsph.movenext
wend
dsph.close
end If




if Request.Form ("Submit")="设置资源" then

If Request.Form ("spacelimt")<>"" Then
If IsNumeric(Request.Form ("spacelimt")) Then
dsph("spacelimt")=Request.Form ("spacelimt")
response.write "总空间限制设置为："&Request.Form ("spacelimt")&" M<br>"
End If
End If

If Request.Form ("Maxbytes")<>"" Then
If IsNumeric(Request.Form ("Maxbytes")) Then
dsph("Maxbytes")=CDbl(Request.Form ("Maxbytes")*1024*1024)
response.write "流量限制设置为："&Request.Form ("Maxbytes")&" M<br>"
End If
End If

If Request.Form ("vdomains")<>"" Then
If IsNumeric(Request.Form ("vdomains")) Then
dsph("vdomains")=Request.Form ("vdomains")
response.write "虚拟主机数量设置为："&Request.Form ("vdomains")&" 个<br>"
End If
End If

If Request.Form ("allowdomain")<>"" Then
If IsNumeric(Request.Form ("allowdomain")) Then
dsph("allowdomain")=Request.Form ("allowdomain")
response.write "子域名数量设置为："&Request.Form ("allowdomain")&" 个<br>"
End If
End If

If Request.Form ("nemails")<>"" Then
If IsNumeric(Request.Form ("nemails")) Then
dsph("nemails")=Request.Form ("nemails")
response.write "邮箱数量设置为："&Request.Form ("nemails")&" 个<br>"
End If
End If

If Request.Form ("nemailf")<>"" Then
If IsNumeric(Request.Form ("nemailf")) Then
dsph("nemailf")=Request.Form ("nemailf")
response.write "邮箱转发数量设置为："&Request.Form ("nemailf")&" 个<br>"
End If
End If

If Request.Form ("nemailml")<>"" Then
If IsNumeric(Request.Form ("nemailml")) Then
dsph("nemailml")=Request.Form ("nemailml")
response.write "邮箱列表数量设置为："&Request.Form ("nemailml")&" 个<br>"
End If
End If

If Request.Form ("nemailr")<>"" Then
If IsNumeric(Request.Form ("nemailr")) Then
dsph("nemailr")=Request.Form ("nemailr")
response.write "邮箱自动回复数量设置为："&Request.Form ("nemailr")&" 个<br>"
End If
End If

If Request.Form ("mysql")<>"" Then
If IsNumeric(Request.Form ("mysql")) Then
dsph("mysql")=Request.Form ("mysql")
response.write "MySQL数量设置为："&Request.Form ("mysql")&" 个<br>"
End If
End If

If Request.Form ("domainptr")<>"" Then
If IsNumeric(Request.Form ("domainptr")) Then
dsph("domainptr")=Request.Form ("domainptr")
response.write "域名转发数量设置为："&Request.Form ("domainptr")&" 个<br>"
End If
End If

If Request.Form ("ftp")<>"" Then
If IsNumeric(Request.Form ("ftp")) Then
dsph("ftp")=Request.Form ("ftp")
response.write "FTP数量设置为："&Request.Form ("ftp")&" 个<br>"
End If
End If


	Set dshost = Server.CreateObject("ADODB.Recordset")	
	'新产品类别
	Sql="Select * from FreeHost.FreeHost_hostProductlist where hosttype='"&dsph("hosttype")&"'"
	dshost.Open Sql,conn,1,1

if dshost("cgi")="y" Then
cgi="ON"
Else
cgi="OFF"
End if
if dshost("php")="y" Then
php="ON"
Else
php="OFF"
End if


URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
ostype=dsserver("ostype")
username=dsph("ftpname")

spacelimt=dsph("spacelimt")
Maxbytes=CDbl(dsph("Maxbytes"))
vdomains=dsph("vdomains")
allowdomain=dsph("allowdomain")
vdomains=dsph("vdomains")
nemails=dsph("nemails")
nemailf=dsph("nemailf")
nemailml=dsph("nemailml")
nemailr=dsph("nemailr")
mysql=dsph("mysql")
domainptr=dsph("domainptr")
ftp=dsph("ftp")
'aftp=dsph("aftp")
'spam=dsph("spam")
'catchall=dsph("catchall")
'ssl=dsph("ssl")
'ssh=dsph("ssh")
'cron=dsph("cron")
'sysinfo=dsph("sysinfo")
'dnscontrol=dsph("dnscontrol")
'suspend_at_limit=dsph("suspend_at_limit")
'packagename=dsph("packagename")
packagename=""
Maxbytes=CDbl(CDbl(Maxbytes)/1024/1024)

temp=ModifyUser2(URL,FreeHostsharekey,username,comment,homedirX,spacelimit,starttime,endtime,type1,type2,type3,email,host,hostcomment,MaxConnections,EnumAppsInPool,DefaultDoc,ScriptMaps,AccessFlags,LogFileDirectory,HttpErrors,MaxBandwidth)

dsph.update

If InStr(temp,"User Modified")>1 Then Response.Write "<br><br>操作成功,返回信息:<br>"
Response.Write temp
FreeHost_oplog session("admusername"),"信息","管理员调整虚拟主机资源:"&username&" 返回信息："&temp
dsph.update
end If


%>


			  </td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
 </div>
	  <br><%end if%>
<br>

<%if Request.Form ("Submit")="主机管理" then

if dsph("Hosttype")="子目录绑定" then Response.Redirect "e.asp?e=子目录绑定类的资源分配请切换到用户区管理。"
if ostype="linux" then Response.Redirect "e.asp?e=DA面板的Linux系统不能使用此功能。"

returnstr = ShowUser2(URL,FreeHostsharekey,username)
'Response.Write returnstr
'Response.End 
if (instr(1,returnstr,"用户不存在！")>0) then 
Response.Write returnstr
Response.End 
end If
if instr(returnstr,"不能连接IIS")>1 then 
siteid=GETvalue(returnstr,";网站标识为：","显示资料出错")
Response.Write "IIS中不存在标识(ID)为"&siteid&"的网站,请在服务器IIS中检查这个网站是否存在，如果网站没有开通成功请删除后重开它。"
Response.End 
end If
if instr(returnstr,"Service Unavailable")>1 then 
Response.Write "受控服务器上的7i24pool池停止了，请您启动它，也可能是受控服务器的IIS不正常造成的，可以重启IIS试。"
Response.End 
end If
if Not instr(returnstr,"用户名：")>1 then 
Response.Write "这台受控服务器自检没有通过，请在站点管理，虚拟主机中自检来分析原因。"
Response.End 
end if 
usrname=GETvalue(returnstr,"FTP用户名：",";FTP密码：")
getpass=GETvalue(returnstr,";FTP密码：",";用户所在目录：")
homedir=GETvalue(returnstr,";用户所在目录：",";磁盘配额上限为:")
spacelimit=GETvalue(returnstr,";磁盘配额上限为:",";磁盘配额已使用:")
spacelimit=replace(spacelimit," MB","")
spaceused=GETvalue(returnstr,";磁盘配额已使用:",";网站标识为：")
siteid=GETvalue(returnstr,";网站标识为：",";网站名：")
sitename=GETvalue(returnstr,";网站名：",";日志目录：")
LogFileDirectory=GETvalue(returnstr,";日志目录：",";IIS连接数：")
MaxConnections=GETvalue(returnstr,";IIS连接数：",";带宽限制：")
If MaxConnections=0 Then MaxConnections=4294967295

MaxBandwidth=GETvalue(returnstr,";带宽限制：",";主机头名：")

if instr(returnstr,",;应用程序池名：")>0 then
MaxBandwidth=GETvalue(returnstr,";带宽限制：",";主机头名：")
serverbind=GETvalue(returnstr,";主机头名：",",;应用程序池名：")
PoolName=GETvalue(returnstr,",;应用程序池名：",";默认首页：")
if (Not instr(returnstr,"_FreeHost_")>1) then 
Response.Write "您的这个网站的应用程序池被改成了 "&PoolName&" 了,请恢复它。池的名称必须是 数字_FreeHost_数字 的格式。"
Response.End 
end if 
AppPoolnum=replace(PoolName,mid(PoolName,instr(1,PoolName,"_")),"")
else
serverbind=GETvalue(returnstr,";主机头名：",";默认首页：")
AppPoolnum=-1
MaxBandwidth=-1
end if

DefaultDoc=GETvalue(returnstr,";默认首页：",";脚本权限：")
AccessFlags=GETvalue(returnstr,";脚本权限：",";应用程序影射：")

ScriptMaps=GETvalue(returnstr,";应用程序影射：",";自定义出错信息：")

HttpErrors=GETvalue(returnstr,";自定义出错信息：",";用户描述为：")


about=GETvalue(returnstr,";用户描述为：",";FreeHostEnd")
about=about&";FreeHostEnd"

type1=GETvalue(about,"FHA:",",FHB:")
type2=GETvalue(about,"FHB:",",FHC:")
type3=GETvalue(about,"FHC:",",FHD:")

starttime=GETvalue(about,",FHD:",",FHE:")
endttime=GETvalue(about,",FHE:",",FHF:")

email=GETvalue(about,",FHF:",",FHG:")
usrinfo=GETvalue(about,",FHI:",";FreeHostEnd")

spaceused=replace(spaceused,"位元組","")

if (instr(1,spaceused,"KB")>0) then
spaceused=int(trim(replace(spaceused,"KB",""))/1024)
end if
if (instr(1,spacelimit,"KB")>0) then
spacelimit=int(trim(replace(spacelimit,"KB",""))/1024)
end if

if (instr(1,spaceused,"字节")>0) then
spaceused=int(trim(replace(spaceused,"字节",""))/1024)
end if
if (instr(1,spacelimit,"字节")>0) then
spacelimit=int(trim(replace(spacelimit,"字节",""))/1024)
end if

if (instr(1,spaceused,"MB")>0) then
spaceused=trim(replace(spaceused,"MB",""))
end if
if (instr(1,spacelimit,"MB")>0) then
spacelimit=trim(replace(spacelimit,"MB",""))
end if

if (instr(1,spaceused,"GB")>0) then
spaceused=trim(replace(spaceused,"GB","")*1024)
end if
if (instr(1,spacelimit,"GB")>0) then
spacelimit=trim(replace(spacelimit,"GB","")*1024)
end if



'Response.Write "用户分类三："&HttpErrors&"<br>"

if (instr(1,spaceused,"KB")>0) then
spaceused=int(trim(replace(spaceused,"KB",""))/1024)
end if
if (instr(1,spacelimit,"KB")>0) then
spacelimit=int(trim(replace(spacelimit,"KB",""))/1024)
end if

if (instr(1,spaceused,"字节")>0) then
spaceused=int(trim(replace(spaceused,"字节",""))/1024)
end if
if (instr(1,spacelimit,"字节")>0) then
spacelimit=int(trim(replace(spacelimit,"字节",""))/1024)
end if

if (instr(1,spaceused,"MB")>0) then
spaceused=trim(replace(spaceused,"MB",""))
end if
if (instr(1,spacelimit,"MB")>0) then
spacelimit=trim(replace(spacelimit,"MB",""))
end if



'Response.Write "脚本影射："&ScriptMaps&"<br>"
'Response.Write "自定义错误："&HttpErrors&"<br>"

%>
 <DIV class="tableborder" id="t3"><table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif"><font color="#FFFFFF">受控服务器上的记录　　<a href="#"  onClick="t3.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
<%

'Response.Write "用户说明："&usrinfo&"<br>"
'Response.Write "用户分类一："&type1&"<br>"
'Response.Write "用户分类二："&type2&"<br>"
'Response.Write "用户分类三："&type3&"<br>"
'Response.Write "已用空间数量:"&spaceused&" M<br>"
'Response.Write "空间大小上限:"&spacelimit&" M<br>"
			%>
            <tr bgcolor="#E4EAF2">
              <td width="28%" height="22" align="right" >网站标识为：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=siteid%></td>
            </tr>
			            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >网站名：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=sitename%></td>
            </tr>
			<tr bgcolor="#E4EAF2">
              <td height="22" align="right" >应用程序池名：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=PoolName%></td>
            </tr>
						<tr bgcolor="#E4EAF2">
              <td height="22" align="right" >多少用户共用一个应用程序池：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=AppPoolnum%></td>
            </tr>						            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >IIS连接数：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=MaxConnections%></td>
            </tr>
			<tr bgcolor="#E4EAF2">
              <td height="22" align="right" >带宽限制：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=MaxBandwidth%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >FTP名：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" >　<%=usrname%></td>
            </tr>
			            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >主机头名：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2" ><%hostname=dsph("hostname")
  if isuseCDN=true Then hostname=Replace(hostname,":80:",":"&CDNORIport&":")

if dsserver("iisver")>6 Then
serverbind=hostname
End if
hostname_arry=Split(serverbind, ",")
for idname=0 to ubound(hostname_arry)%>
                　<%=hostname_arry(idname)%><br>
              <%next%></td>
            </tr>
<tr bgcolor="#E4EAF2">
              <td height="22" align="right" >默认首页为：</td>
              <td width="72%" height="22" align="left" bgcolor="#E4EAF2">　<%=replace(DefaultDoc,",","<br> 　")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >产品类型：</td>
              <td height="22" align="left" bgcolor="#E4EAF2">　<%=dsph("Hosttype")%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >脚本权限为：</td>
              <td height="22" align="left" bgcolor="#E4EAF2"><%=AccessFlags%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >用户所在目录：</td>
              <td height="22" align="left" bgcolor="#E4EAF2">
        <%=homedir%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >建立时间：</td>
              <td height="22" align="left" bgcolor="#E4EAF2">　<%=starttime%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >到期时间：</td>
              <td height="22" align="left" bgcolor="#E4EAF2">　<%=endttime%></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >已用空间数量：</td>
              <td height="22" align="left" bgcolor="#E4EAF2">　<%=spaceused%> M　<a href="http://sys.7i24.com/system/support/show.asp?id=103051142038" target="_blank">如果占用大小不对可以参考&gt;&gt;&gt;</a></td>
            </tr>
            <tr bgcolor="#E4EAF2">
              <td height="22" align="right" >空间大小上限：</td>
              <td height="22" align="left" bgcolor="#E4EAF2">　<%=spacelimit%> M</td>
            </tr>
          </tbody>
        </table>
</div>
<br>
 
<form action="handhost3.asp" method="post" name="autoopen">  
 <DIV class="tableborder" id="t4"> 
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">升级或降级产品　　<a href="#"  onClick="t4.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="70" align="right" >&nbsp;</td>
              <td width="80%" height="22" align="left" >　更产品类型:
                <%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist order by id asc"
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
产品列表为空.
<%else%>
<select name="HosttypeAuto" id="HosttypeAuto">
  <%while not dsX.Eof%>
  <option value="<%=dsX("Hosttype")%>" <%if dsX("Hosttype")=dsph ("Hosttype") then%>selected<%
  ServerlistID=dsX("ServerlistID")
  end if%>><%=dsX("Hosttype")%></option>
  <br>
  <%
dsX.movenext
wend%>
</select>
<%end if%>
<br>
　
<input name="chmoneyauto" type="checkbox" id="chmoneyauto" value="checkbox">
从用户金额中扣除(如果不选将只更改而不扣费)(产品不变不会扣)<br>
　　 　价格：
<input name="usermoneyauto" type="text" id="usermoneyauto" size="4" value="">
元(不填价格将按产品差价扣除或退回)
<input name="istestch1" type="checkbox" id="istestch1" value="y">
将试用的用户变更成正式用户 <br>
　开通时间:
<input name="starttimeauto" type="text" id="starttimeauto" value="<%=dsph("starttime")%>" size="20" maxlength="30">
　到期时间:
<input name="endtimeauto" type="text" id="endtimeauto" value="<%=dsph("endtime")%>" size="20" maxlength="30">
<input name="id" type="hidden"size="4" value="<%=dsph("id")%>">
<input name="auto" type="submit" id="auto" value="下一步">
			  </td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
</div>
<br>
<br>


 
 <DIV class="tableborder" id="t5"> 
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">全部内容手工设置　　<a href="#"  onClick="t5.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="70" align="right" >&nbsp;</td>
              <td width="80%" height="22" align="left" ><%if not isnull(dsph("repaymoney")) then%>
　<font color="#FF0000">此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年</font>
<%end if%>
<p>　分配的空间大小：
                    <input name="spacelimit" type="text" id="spacelimit" size="4" value="<%=spacelimit%>">
  M IIS连接数：
  <input name="MaxConnections" type="text" id="MaxConnections" size="8" value="<%=MaxConnections%>">
  　
  <br>
  　带宽限制：
  <input name="MaxBandwidth" type="text" id="MaxBandwidth" value="<%=MaxBandwidth%>" size="10" maxlength="10">
  字节/秒(默认是4294967295表示无限制)<br>
  　多少用户共用一个应用程序池(IIS6):
  <input name="AppPoolnum" type="text" id="AppPoolnum" size="3" value="<%=AppPoolnum%>">
  　
  <input name="Submit" type="submit" value="下一步>>" onClick="document.autoopen.Submit.value ='请等待不要重复刷新！....';document.autoopen.submit();">
<br>
<%if Application("openmustre")=true and Application("beianusecode")=1 then%><br>

        　绑定域名前，您可以检查是否备案<br>
　输入要检查的新域名：
          <input name="icpdomainnowcheck" type="text" size="20" onBlur="doicpcheck(this.value);">
        <br>
        <br>
　再输入验证码(稍等一会右边的图片才会出现)：
<input name="icpcode" type="text" id="icpcode" size="6" maxlength="10" onmouseover="this.focus()" onFocus="this.select()">
<img id=imgcode height=50 src="" width=200 name=imgcode style="display:none" onClick="doicpcheck(document.autoopen.icpdomainnowcheck.value);document.autoopen.icpcode.value='';">
<br>
<br>
　<a href="javascript:doicpcheckend(document.autoopen.icpcode.value);">再点这儿检查备案状态&gt;&gt;&gt;</a>　　检查结果(请耐心等候两分钟)：
<div id="divicpinfo"><br>
</div>
<%end if%>

  <br>
  　主机头名：<br><%hostname=serverbind
  if isuseCDN=true Then hostname=Replace(hostname,":80:",":"&CDNORIport&":")

  If dsph("iphead")=true Then
Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where HostID="&dsph("id")
		dsX.Open Sql,conn,1,1
If not dsX.Eof Then
   hostname=replace(hostname,dsX("IP")&":80:"&dsX("IP")&",","")
end if
  end if
hostname_arry=Split(hostname, ",")
for i=0 to ubound(hostname_arry)
hostname_arry(i)=replace(hostname_arry(i), ",","")

hostname_arryX=Split(hostname_arry(i), ":"&CDNORIport&":")
If UBound(hostname_arryX)=1 Then hostname_arry(i)=hostname_arryX(1)

session("hostname"&(i+1))=hostname_arry(i)
%>
　域名<%=i+1%>：<input name="hostname<%=i+1%>" type="text" value="<%=hostname_arry(i)%>" size="30">
<font color="#000000"><a href="admicpdb.asp" target="_blank">将域名备案信息添加到本地数据库&gt;&gt;</a> </font><br>
<%next
if i<5 then
for i=i to 5 %>
　域名<%=i+1%>：<input name="hostname<%=i+1%>" type="text" value="" size="30"><br>
<%next
end if
%>　更多域名绑定可以在用户区主机面板中绑。

<%if Application("hostoneip")=true then
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where (HostID=0 or HostID="&dsph("id")&") and ServerlistID="&dsph("ServerlistID")&" order by orderbyid desc"
		dsX.Open Sql,conn,1,1
If not dsX.Eof Then%><br>　更改虚拟主机独立IP:<select name="ipid">
<option value=0>任何IP</option>
<%
while not dsX.eof
%>
<option value="<%=dsX("id")%>" <%if dsX("HOSTid")=dsph("id") then%>selected<%end if%>><%=dsX("IP")%></option><%
dsX.movenext
wend%></select><%end if%>
<input type="checkbox" name="nullhead" value="1" <%if dsph("nullhead")=true then%>checked<%end if%>>
为这个虚拟主机绑定空主机头
<input type="checkbox" name="iphead" value="1" <%if dsph("iphead")=true then%>checked<%end if%>>
为这个虚拟主机绑定IP作主机头
<%end if%><br>
　如果存在没有备案成功的域名(本地备案数据库)：
<input type="radio" name="openmustre" value="1" <%if Application("openmustre")=true then%>checked<%end if%>>
不允许开通 　　
<input type="radio" name="openmustre" value="0" <%if Application("openmustre")=false then%>checked<%end if%>>
允许开通(<font color="#000000"><a href="admicpdb.asp" target="_blank">将域名备案信息添加到本地数据库&gt;&gt;</a> </font>)<br>
　到期时间：
<input type="text" name="endtime" size="20" maxlength="30" value="<%=dsph("endtime")%>">
默认首页：
<input name="DefaultDoc" type="text" id="host1" size="30" value="">
<br>
　日志目录:
<input name="LogFileDirectory" type="text" id="host1" size="30" value="">
<br>
　AccessFlags：
<input name="AccessFlags" type="text" id="host1" size="5" value="">
1为静态网页，513为asp/aspx/php,517为cgi<br>
　修改应用程序影射：
<textarea name="ScriptMaps" cols="50" id="host1"></textarea>
<br>
　修改自定义错误：
<textarea name="HttpErrors" cols="50" id="host1"></textarea>
<br>
　
<input name="chmoney" type="checkbox" id="chmoney" value="y">
从用户金额中扣除(产品不变不会扣) 价格：
<input name="usermoney" type="text" id="usermoney" size="4" value="">
元(不填价格将按产品差价扣除或退回)<br>
　变更产品类型:
<%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist order by id asc"
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
产品列表为空.
<%else%>
<select name="Hosttype" id="Hosttype">
  <%while not dsX.Eof%>
  <option value="<%=dsX("Hosttype")%>" <%if dsX("Hosttype")=dsph ("Hosttype") then%>selected<%
  ServerlistID=dsX("ServerlistID")
  end if%>><%=dsX("Hosttype")%></option>
  <br>
  <%
dsX.movenext
wend%>
</select>
<%end if%>
<input name="istestch2" type="checkbox" id="istestch2" value="y">
将试用的用户变更成正式用户 <br>
　此虚拟主机现有的应用程序影射：<br>
<%=ScriptMaps%>
<p></p>
			  </td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
</div>
</form>


	  </TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>


 <%end if%>
 <script src="/inc-freehost-function/icpcheck.js"></script>
<%=htmlwrite("html10")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
