<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/Conn.asp" -->
<!--#Include File="Func.asp"-->
<!--#include file="../include/Md5.asp"-->
<%Response.Charset="gb2312"%>
<%
dim LoginName,LoginPassword,UserName,Password,Working,rs,sql
LoginName=trim(request("txtUserName"))
LoginPassword=Md5(request("txtPassword"))
set rs = server.createobject("adodb.recordset")
sql="select * from Angel_User where UserName='"&LoginName&"'"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
response.write("{""status"": 0, ""msg"": ""温馨提示：无此用户名！""}")
response.end
else
   UserName=rs("UserName")
   Password=rs("UserPass")
   Working=rs("isEnable")
end if
if LoginPassword<>Password then
response.write("{""status"": 0, ""msg"": ""错误提示：密码错误！""}")
response.end
end if

if Working=0 then
   response.write("{""status"": 0, ""msg"": ""错误提示：用户已被禁用！""}")
   response.end
end if

if UCase(LoginName)=UCase(UserName) and LoginPassword=Password then
	rs("LastIP")=GetIP
	rs("LastTime")=Now()
   rs.update
   rs.close
   set rs=nothing
   session("UserName")=UserName
   session("MemLogin")="Succeed"
   session.timeout=60
   response.write("{""status"": 1, ""msg"": ""会员登录成功！"", ""url"": ""meberlist.asp""}")
   response.end
end if
%>