<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("HOSTAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。此功能只有代理可以操作。"
ElseIf not IsNumeric(session("HOSTAUID"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf Instr(1, Request("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&session("HOSTAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="不存在的虚拟主机ID！"
end if
end If

if not ef then
if dsph("agent1")<>session("agentusername") then
	ef=True
	ec="此虚拟主机ID并不是当前代理名下所有！"
end If
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsHostpdlist.Open Sql,conn,1,1
if dsHostpdlist.Eof then
	ef=True
	ec="产品类型不存在！"
end if
end If

if not ef 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
	ostype=dsserver("ostype")'linux
dim isAgnHostSer
if dsserver("agent1")=dsph("agent1") then
isAgnHostSer=true
Else
isAgnHostSer=false
end if
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->
　代理 <%=session("agentusername")%> 管理名下用户 <%=dsph("username")%> 的虚拟主机 FTP用户名：<%=dsph("ftpname")%>


<br>
<br><form action="agn-specadm2.asp" method="post">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">转移用户：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>　本功能让您自己将此虚拟主机转到另一用户名下。</TD>
      </TR>
    <TR>
      <TD width="16%" rowspan="3" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="38" bgColor=#ffffff>          　 原用户名： <%=dsph("username")%> 　  </TD>
    </TR>
    <TR>
      <TD height="38" bgColor=#ffffff><input name="op" type="hidden" id="op" value="a">
　 新用户名：
  <input name="newusername" type="text" id="newusername" value="" size="14" maxlength="14"></TD>
    </TR>
    <TR>
      <TD height="38" bgColor=#ffffff>　
        <input name="Submit" type="submit" id="Submit" value="马上转移">
        <input name="id" type="hidden" value="<%=session("HOSTAUID")%>"></TD>
    </TR>
  </TBODY>
</TABLE>
</form>

<form action="agn-specadm2.asp" method="post" name="autoopen2">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">高级管理：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>&nbsp;</TD>
      </TR>
    <TR>
      <TD width="16%" rowspan="3" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="40" bgColor=#ffffff>　
        <input name="pauseweb" type="radio" value="pauseweb" checked>
超过使用期限
<input name="pauseweb" type="radio" value="pauseweb2">
政治或色情
<input name="pauseweb" type="radio" value="pauseweb3">
上传引起不稳定的程序或其他原因<br>
　
<input name="pauseweb" type="radio" value="pauseweb4">
没有备案或备案不成功
<input name="id" type="hidden" value="<%=session("HOSTAUID")%>"></TD>
    </TR>
    <TR>
      <TD height="40" bgColor=#ffffff>　
        <input type="submit" name="Submit" value="暂停">
<input type="submit" name="Submit" value="停止">
<input type="submit" name="Submit" value="恢复"><script language=JavaScript>
<!--
	function chkFormweb(theform)
	{
			if(! confirm("请确认是否要删除?\n注意，如果删除是没有办法恢复的。"))
				return false;
	}
//-->
</script></TD>
    </TR>
    <TR>
      <TD height="40" bgColor=#ffffff>　
        <input type="submit" name="Submit" value="删除" onClick="return chkFormweb(this)">
(删除是不可恢复的删除，而且不会返款)</TD>
    </TR>
  </TBODY>
</TABLE>
</form>

<%if isAgnHostSer Then%>
<font color="#0000FF">独立模式专有内容：</font><br>
<form action="agn-specadm2.asp" method="post" name="autoopen2">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">高级管理：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>　回收池可以解锁文件：</TD>
      </TR>
    <TR>
      <TD width="16%" rowspan="2" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="38" bgColor=#ffffff>　 
        <input type="submit" name="Submit" value="回收池">
        <input name="id" type="hidden" value="<%=session("HOSTAUID")%>"></TD>
    </TR>
    <TR>
      <TD bgColor=#ffffff><script language=JavaScript>
<!--
	function chkFormweb(theform)
	{
			if(! confirm("请确认是否要清空?\n注意，如果清空是没有办法恢复的。"))
				return false;
	}
//-->
      </script></TD>
    </TR>
  </TBODY>
</TABLE>
</form>

<%
On Error Resume next
username=dsph("Ftpname")
URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
'tourl=dsserver(""&Request.Form ("pauseweb")&"")
password=Request.Form ("password")

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 
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连接数：",";带宽限制：")

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")


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 "ftp用户名:"&usrname&"<br>"
'Response.Write "密　码:"&getpass&"<br>"
'Response.Write "用户所在目录："&homedir&"<br>"
'Response.Write "建立时间："&starttime&"<br>"
'Response.Write "到期时间："&endttime&"<br>"
'Response.Write "邮箱："&email&"<br>"
'Response.Write "网站标识为："&siteid&"<br>"
'Response.Write "网站名："&sitename&"<br>"
'Response.Write "IIS连接数:"&MaxConnections&"<br>"
'Response.Write "带宽限制:"&MaxBandwidth&"<br>"
'Response.Write "应用程序池名："&PoolName&"<br>"
'Response.Write "多少用户共用一个应用程序池:"&AppPoolnum&"<br>"
'Response.Write "主机头名："&serverbind&"<br>"
'Response.Write "默认首页为："&DefaultDoc&"<br>"
'Response.Write "脚本权限为："&AccessFlags&"<br>"
'Response.Write "用户说明："&usrinfo&"<br>"
'Response.Write "用户分类一："&type1&"<br>"
'Response.Write "用户分类二："&type2&"<br>"
'Response.Write "用户分类三："&type3&"<br>"
'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 "已用空间数量:"&spaceused&" M<br>"
'Response.Write "空间大小上限:"&spacelimit&" M<br>"
If err.number<>0 Then%>
<font color="#FF0000">连接受控端出错，无法显示空间真实数据，<a href="http://sys.7i24.com/system/support/default.asp?id3=1&id4=3&id5=10" target="_blank">请按以下帮助检查&gt;&gt;&gt;</a></font>
<%else%>
<form action="agn-specadm2.asp" method="post" name="autoopen3">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">高级调整：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>　本功能让您自己定义这个虚拟主机的具体信息：以下数据直接来自于IIS。</TD>
      </TR>
    <TR>
      <TD width="16%" rowspan="2" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="38" bgColor=#ffffff>　分配的空间大小：
        <input name="spacelimit" type="text" id="spacelimit" size="4" value="<%=spacelimit%>">
M IIS连接数：
<input name="MaxConnections" type="text" id="MaxConnections" size="8" value="<%=MaxConnections%>">
(输入4294967295表示无限制)<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%>">

<br>
　到期时间:
<input type="text" name="endtime" size="20" maxlength="30" value="<%=dsph("endtime")%>">
<br>
　
<!--<input name="chmoney" type="checkbox" id="chmoney" value="y">
从用户金额中扣除：
<input name="usermoney" type="text" id="usermoney" size="4" value="">
元　-->
<input name="istestch2" type="checkbox" id="istestch2" value="y">
将试用的用户变更成正式用户 <br>
<br></TD>
    </TR>
    <TR>
      <TD height="38" bgColor=#ffffff>　
        <input name="Submit" type="submit" value="下一步" onClick="document.autoopen3.showinfo.value ='请等待不要重复刷新！....';">
        <input name="showinfo" type="text" value="" size="20" readonly="true" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" >
        <input name="id" type="hidden" value="<%=session("HOSTAUID")%>"></TD>
    </TR>
  </TBODY>
</TABLE>
</form>
<%End if%>
<%end if%>
<br>
<br>

　<a href="selfhostmodify.asp?id=<%=session("HOSTAUID")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-hostadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>