<!-- #include file="share.asp" -->
<!-- #include file="online.asp" -->
<%
dim uid
dim password
dim fromurl
on error resume next
uid=lcase(request.form("username"))
password=lcase(request.form("password"))
fromurl=request.form("fromurl")
if fromurl="" then
	fromurl="index.asp"
end if

dim rs
dim sql
sql="select * from userinfo where uid='"&uid&"' and password='"&password&"'"
'opendb
set rs=conn.execute(sql)
if rs.eof then
	response.redirect "error.asp?emsg=用户名或密码错误。"
	response.end
elseif rs("authority")<0 then
	response.redirect "error.asp?emsg=你的用户名已经被管理员冻结，请联系管理员。"
	response.end
else
	' add session
	session.timeout=20
	addonline session("blueuid"),"论坛首页"
	session("bluelogin")="yes"
	session("blueuid")=uid
	session("blueauthority")=rs("authority")
	session("bluesn")=rs("sn")
	session("bluepos")=rs("pos")
	' add session end
	addusersn
	%>
<script language="javascript">
window.location.replace("<%=fromurl%>");
</script>
<%
end if
rs.close
set rs=nothing
'closedb
%>
<% closedb %>
