<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/Function.asp"-->
<!--#include file="inc/md5.asp"-->
<%
Call ConnectionDataBase(1)
UserName = Request.Form("UserName")
UserPwd = Request.Form("UserPwd")
ChkCode = Trim(Request.Form("ChkCode"))
Call ChkIsNull(UserName,"请输入用户名!")
Call ChkIsNull(UserPwd,"请输入密码!")
Call ChkIsNull(ChkCode,"请输入验证码!")
IF Cstr(Session("GetCode"))<>Cstr(ChkCode) Then Call Success("验证码错误!","Index.asp")
Session("GetCode")=""
Sql = "SELECT TOP 1 * FROM T_Admins WHERE UserName='"& UserName &"'"
SetRs Rs,Sql,conn,1,1
IF Not Rs.EOF Then
	IF Rs("Locked") Then Call IsError("该用户已经被锁定!")
	IF Rs("UserPwd")<>MD5(UserPwd) Then Call Success("登陆密码错误!","Index.asp")
	Session("WebAdminsUserName")=UserName
	Session("WebAdminsLoginTime")=time()
	Response.Redirect("Main.asp")
Else
	Call Success("用户名不存在!","Index.asp")
End IF
%>