<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("HOSTAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("dirname")="" Then
	ef=True
	ec="请设置子目录名！"
ElseIf len(Request.Form ("dirname"))>50 Then
	ef=True
	ec="目录名超过允许的长度！"
ElseIf len(replace(Request.Form ("dirname"),"\",""))<2 Then
	ef=True
	ec="目录名应该超过1个字符，也不能只输入\号！"
ElseIf RegExpTest("[^A-Za-z0-9]",replace(Request.Form ("dirname"),"\","")) Then
	ef=True
	ec="目录名中有非法字符！"
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
	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="服务器不存在！"
end if
end if

if not ef then
URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
username=dsph("ftpname")
dirname="\web\"&Request.Form ("dirname")
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->
 　	清空目录数据
 
<br>
<br>
<br>
<%
returnstr =  CleanWeb(URL,FreeHostsharekey,username,dirname)
if (instr(1,returnstr,"NOT IMPLEMENTED")>0) then 
Response.Write "请先升级受控端" 
Response.End 
end if 
Response.Write returnstr


%>　
<br>
<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%>