<!--#include file="conn.asp" -->
<!--#include file="inc/md5.asp"-->
<!--#include file="ftbbs_nav.asp" -->
<%
bbsuser=trim(request.form("bbsuser"))
password=trim(request.form("password"))

call CheckCharStr(bbsuser,1)
call CheckCharStr(password,1)

If Not codepass Then
   call ftbbs_msg("验证码错误，请重新输入！","index.asp")
end if

str="select * from clubuser where clubuser_name='"&bbsuser&"' and jfmsign=0"
set rs=server.createobject("adodb.recordset")
rs.open str,conn,3,1
if rs.eof then
   call ftbbs_msg("用户名不存在或还没有被激活！","index.asp")
else
   if rs("clubuser_password")=md5(password) and rs("clubuser_name")=bbsuser then
   '设置cookies
   Response.Cookies("clubuser_id")=rs("clubuser_id")
   Response.Cookies("bbsuser")=rs("clubuser_nickname")'昵称
   Response.Cookies("name")=rs("clubuser_name")'用户名
   Response.Cookies("clubuser_password")=CodeCookie(rs("clubuser_password"))
   Response.Cookies("bz")=rs("bbsmanager")
   Response.Cookies("bbsadmin")=rs("bbsadmin")
   Response.Cookies("payuser")=rs("payuser")
      If Cint(Request.Form("ckies"))>0 then
   Response.Cookies("clubuser_id").Expires=date+Cint(Request.Form("ckies"))
   Response.Cookies("bbsuser").Expires=date+Cint(Request.Form("ckies"))
   Response.Cookies("name").Expires=date+Cint(Request.Form("ckies"))
   Response.Cookies("clubuser_password").Expires=date+Cint(Request.Form("ckies"))
   Response.Cookies("bbsadmin").Expires=date+Cint(Request.Form("ckies"))
   Response.Cookies("bz").Expires=date+Cint(Request.Form("ckies"))
   Response.Cookies("payuser").Expires=date+Cint(Request.Form("ckies"))
      end if
      if rs("payuser")=3 then
      call ftbbs_msg("对不起,你的用户名被管理员封锁了!","inddex.asp")
      end if

   sql="update clubuser set clubuser_lasttime='"&Ftbbs_Time&"',clubuser_enter_count=clubuser_enter_count+1,tili=tili+100 where clubuser_name='"&trim(request.form("bbsuser"))&"'"
   conn.execute(sql)
   response.redirect "usercenter.asp?userid="&request.Cookies("clubuser_id")
   else
   call ftbbs_msg("你的密码错误，请重新登录！","index.asp")
   end if
end if
conn.close
%>