<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
	Response.Expires = 0 
	Response.AddHeader "Pragma","no-cache"
	Response.AddHeader "cache-ctrol","no-cache"

If session("VPSAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(session("VPSAUID"))  Then
	ef=True
	ec="id应该是数字！"
elseif Request.Form ("url")="" or RegExpTest("[^.A-Za-z0-9_]",Replace(Replace(Replace(Request.Form ("url"),"http://",""),"/",""),":","")) Then
	ef=True
	ec="url没填或非法！"
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_VPS where id='"&session("VPSAUID")&"'"
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="不存在的数据库产品ID！"
end if
end if

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


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

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






if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-vpsadm-top.asp"-->
　
<p>云服务器自助管理


  <br>
  <br>
  <br>
CDN操作
 
<br>
<br>
<br>
<%
URL=dsCDNserver("site")
FreeHostsharekey=dsCDNserver("FreeHostsharekey")

If Request.Form ("Submit")="马上更新缓存" Then
pushurl=Request.Form ("url")
op=0
CDNcon=" -p 80 -m PURGE "+pushurl
retstr="  尝试发送命令："&CDNOP(URL,FreeHostsharekey,CDNcon,cachemgr,mime,squid,squid_radius_auth,hosts,op)
response.write retstr&" 如果提示命令失败很可能是URL不存在，或并没有缓存。"'&CDNcon
end if

%>
<br>
<br>
  <br>
  <br>
  <br>
  　<a href="selfvpsmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回]</font></a>
  <!--#include virtual="/inc-freehost-function/template-vpsadm-end.asp"-->
  <%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>