<!--#include file="conn.asp"-->
<!--#include file="admin/config.asp"-->
<!--#include file="admin/inc/char.asp"-->
<%if SiteSetting(8)="no" then%>
<script language=vbscript>
  MsgBox "会员功能暂不开放！"
  location.href = "javascript:history.back()"
</script>
<%else
dim usr,pwd,cookiesdate
dim rs,sql
usr=chStr(Trim(Request.Form("usr")))
pwd=chStr(Trim(Request.Form("pwd")))
cookiesdate=Trim(Request.Form("cookiesdate"))
sql="select top 1 LockUser from UserInfo where USR='"&usr&"' and PWD='"&pwd&"'"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
%>
<script language=vbscript>
  MsgBox "您输入的用户名与密码不匹配！"
  location.href = "javascript:history.back()"
</script>
<%elseif rs(0)=True then%>
<script language=vbscript>
  MsgBox "此用户已被锁定，请与管理员联系！"
  location.href = "javascript:history.back()"
</script>
<%else
	dim ip
	ip=Request.ServerVariables("REMOTE_ADDR")
	Response.Cookies("ydxz")("usr")=usr
	Response.Cookies("ydxz")("pwd")=pwd
	if cookiesdate<>"0" then Response.Cookies("ydxz").Expires=Date+cookiesdate
	conn.execute("update UserInfo set Point=Point+"&cint(LoginPoint)&",LoginTimes=LoginTimes+1,LastLogin=Now(),LastLoginIP='"&ip&"' where USR='"&usr&"'")
	Response.redirect(request.ServerVariables("HTTP_REFERER"))
end if
set rs=nothing
end if
conn.close
set conn=nothing
%>