<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostEmail.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
  Set dsreg = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_AGENT where username='"&session("agentusername")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsreg.Open Sql,conn,1,3
If dsreg.Eof Then
		ef=True
		ec="代理名不存在或密码出错了！"
end if
end if

if not ef Then
if Request("awstoadmin")="y" then
dsreg ("awstoadmin")=true
else
dsreg ("awstoadmin")=false
End if
session("awstoadmin")=dsreg("awstoadmin")
dsreg.Update
dsreg.Close
set dsreg=nothing
conn.Close 
set conn=nothing


Response.Redirect "aws.asp"
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>