<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("VPSAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(session("VPSAUID"))  Then
	ef=True
	ec="vps应该是数字！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsphVPS = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_VPS where id='"&session("VPSAUID")&"'"
	dsphVPS.Open Sql,conn,1,1
if dsphVPS.Eof then
	ef=True
	ec="不存在的VPS ID！"
end if
end if

if not ef Then
If dsphVPS("endtime")<Now Then
	ef=True
	ec="产品已过期,不能再操作！"
End If
end If

If not ef then
if not dsphVPS("status")="正常" then
		ef=True
		ec="必须是处于正常状态的主机才能管理！"
end if
end if


if not ef then
	Set dsVPSpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_VPSProductlist where VPStype='"&dsphVPS("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='"&dsphVPS ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end If


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


  <br>
  <br>
  <br>
更改状态
 
<br>
<br>
<br>
<%


URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
username=dsphVPS("username")
vpsname=dsphVPS("vpsname")
'oridir=dsserver("osfile"&Request.Form ("osid"))
'homedir=dsserver("homedir")
todir=dsphVPS("vhdpath")
MAXspace=dsphVPS("MAXspace")
'IP=dsX("IP")
'IPmask=dsX("IPmask")
'IPgateway=dsX("IPgateway")
'IPdns1=dsX("IPdns1")
'IPdns2=dsX("IPdns2")

action="start"
If Request("op")="start" Then action="start"
If Request("op")="turnoff" Then action="turnoff"
If Request("op")="reset" Then action="reset"

varcon="action "&vpsname&" "&action&" now"
temp=VPSOP(URL,FreeHostsharekey,varcon,0)'0=now

'Response.Write varcon

Response.Write temp
%>
<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%>
</p>
