<!--#include virtual="inc/General.inc.asp"-->
<%
username = Replace(request("username"),"'","''")
password = MD5(request("password"))
if username="" or password="" then ErrorInfo "用户名或密码不能为空！"
set rs = server.createobject("adodb.recordset")
rs.open "select * from manage where UserName='" & username & "'",conn,1,1
if not rs.eof then
	if password<>rs("password") then
		rs.close
		set rs=nothing
		CloseConnection()
		ErrorInfo "密码错误！"
	elseif rs("isstop")&""="1" then
		rs.close
		set rs=nothing
		CloseConnection()
		ErrorInfo "此用户已被禁用！"
	else
		Response.Cookies("UserID")=rs("UserID")
		Response.Cookies("UserName")=rs("UserName")
		Response.Cookies("Limit")=rs("Limit")
		Response.Cookies("ManageFlag")=1
		rs.close
		set rs=nothing
		CloseConnection()
		Response.Redirect "welcome.asp"
	end if		
else
	rs.close
	set rs=nothing
	CloseConnection()
	ErrorInfo "此用户不存在！"
end if
%>