<%@ Language=VBScript %>
<!--#include virtual="/inc/FreeHost-AG-Function.asp"-->
<%title="切换用户"%>
<%
If session("agentusername")="" Then
Response.Redirect "default.asp"
end if

username=Request("username")
If username="" then username=session("agentusername")
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("username")="" Then
	ef=True
	ec="请您输入子代理名！"
ElseIf RegExpTest("[^A-Za-z0-9]",username) Then
	ef=True
	ec="用户名中有非法字符！"
end If


If not ef Then
'		response.write session("APIOPcookie")
'			response.End
APIret=GETOP("/agent/changeagnnext.asp",Request.QueryString)
If InStr(APIret,title) Then
APIret=mid(APIret,InStr(APIret,title)+Len(title))
End If
If APIret<>"" Then
session("agentusername_backto")=session("agentusername")
session("agentpasswordORI_backto")=session("agentpasswordORI")

			session("agentusername")=username
			session("agentpasswordORI")=APIret
			session("username")=""
			session("password")=""

'		response.write session("agentusername_backto")&session("agentpasswordORI_backto")
'			response.End

Response.Redirect "logininfo.asp"
End if
end If

if not ef then%>
<!--#include virtual="/agent/agent-moban.asp"-->
<%end If

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