<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #INCLUDE File = "inc.asp" -->
<!-- #INCLUDE File = "config.asp" -->
<%
Dim sUserID, sPassword, sURL
sUserID = Trim(Request.Form("USERID"))
sPassword = Request.Form("PASSWORD")
sURL = Request.Form("URL")
If sUserID = Empty Or sPassword = Empty Then Err("用户名和密码不能为空！")

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

Dim rst
Set rst = oChat.GetUser(sUserID)
If rst.EOF Then
	Err("该用户不存在！")
Else
	If rst("PASSWORD") <> sPassword Then Err("密码输入错误！")
End If


Response.Cookies("GUID") = rst("GUID")
Response.Cookies("USERID") = rst("USERID")
Response.Cookies("PASSWORD") = rst("PASSWORD")

If adDomainLimited Then
	Response.Cookies("GUID").Domain = g_SiteDomain
	Response.Cookies("USERID").Domain = g_SiteDomain
	Response.Cookies("PASSWORD").Domain = g_SiteDomain
End If

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