<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #INCLUDE FILE = "../inc.asp" -->
<!-- #INCLUDE FILE = "../config.asp" -->
<%
Dim sName, sPassword, sURL, iGUID
sName = Trim(Request.Form("Name"))
sPassword = Trim(Request.Form("Password"))
sURL = Request.Form("URL")

Dim oChat
Set oChat = Server.CreateObject("LSChat.Users")
oChat.Configure g_SiteName, g_SiteDomain, g_DBString, g_ErrFile, g_ScriptName

Dim rst, rst2
Set rst = oChat.GetUser(sName)

If rst.EOF Then
	err("无此用户！<a href=""javascript:history.go(-1)"">返回</a>")
Else
	If rst("PASSWORD") <> sPassword Then err("用户密码错！<a href=""javascript:history.go(-1)"">返回</a>")
	
	Set rst2 = oChat.GetChatUser(rst("GUID"))
	If rst2("ChatGroup") <> "Administrators" Then err("你不是管理员，请速速离去！")
	Response.Cookies("Admin") = rst2("NickName")
	Response.Cookies("AdminLoged") = "True"
	
	If adDomainLimited Then
		Response.Cookies("Admin").Domain = g_SiteDomain
		Response.Cookies("AdminLoged").Domain = g_SiteDomain
	End If
	rst2.Close
	Set rst2 = Nothing
End If

rst.Close
Set rst = Nothing
Response.Redirect sURL
%>