<%@ Language=VBScript %>
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmhostset")="" and session("canadmhost")="" and session("canadmhostch")="" and session("canadmhostmidsub")="" and session("canadmhostmiddomain")="" and session("canadmhostmidcpu")="" and session("canadmhostmidrepay")="" and session("canadmhostdel")=""  and session("canadmhostoth")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf Request.QueryString ("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf not IsNumeric(Request.QueryString ("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='"&Request.QueryString ("id")&"'"
			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="不存在的cdn！"
end if
end if

If not ef then
if not dsph("status")="正常" And Request.QueryString ("go")<>"c" 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="服务器不存在！"
end if
end If

if not ef Then
session("HOSTOSTYPE")=dsserver("ostype")
session("HOSTAUID")=dsph("id")'2007-3-19
session("HOSTAUBAIID")=dsph("id")'2007-3-19
session("hostAUID")=dsph("id")
if Request.QueryString ("go")="a" then Response.Redirect "/hostadm/selfhostmodify.asp?id="&dsph("id")
'if Request.QueryString ("go")="c" then Response.Redirect "/cdnadm/selfcdnmodifyrepay.asp?id="&dsph("id")
'if Request.QueryString ("go")="d" then Response.Redirect "/cdnadm/selfcdnmodifyup.asp?id="&dsph("id")
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>