<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户登录</title>
</head>
<!--#include file="conn.asp" -->
<!--#include file="inc/md5.asp"-->
<!--#include file="ftbbs_nav.asp" -->
<%
call FTBBS_HTML_MB
getcodeoff=Application("FTBBSMB")(30,0)
flag=request("flag")
if flag="Y" then
  geturl=request("reurl")
else
  geturl="default.asp"
end if
if request("act")="y" then
bbsuser=trim(request.form("bbsuser"))
password=trim(request.form("password"))

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

If getcodeoff=1 Then
  If Not codepass and session("errorlogin")>=3 Then
      call ftbbs_msg("验证码错误，请重新输入！","userlogin.asp")
  end if
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("用户名不存在或还没有被激活！","userlogin.asp")
else
   if rs("clubuser_password")=md5(password) and rs("clubuser_name")=bbsuser then
      if rs("payuser")=3 then
         call ftbbs_msg("对不起,你的用户名被管理员封锁了!","userlogin.asp")
      end if
'设置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")
Response.Cookies("bokeer")=rs("bokeer")
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"))
Response.Cookies("bokeer").Expires=date+Cint(Request.Form("ckies"))
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)
session("errorlogin")=0
response.redirect geturl
'response.redirect "default.asp"
  else
   session("errorlogin")=session("errorlogin")+1
   call ftbbs_msg("你的密码错误，请重新登录！","userlogin.asp")
  end if
 end if
end if
%>
<script language=javascript src="inc/cookies.js"></script>
<script>
var stylecook = getCookie("STYLESHOW");
var style;
var strstyle;
if(stylecook=="")
{
 stylecook=1;
}
else
{
 stylecook++;
}
style="main0"+stylecook+".css";
strstyle="<link href=\"css/"+style+"\"  rel=\"stylesheet\" type=\"text/css\"> ";
document.write(strstyle);
</script>
<script language="javascript">
<!--
	function check(form)
	{
    if (form.bbsuser.value=="")
    	{
    		alert("请填写用户名！");
    		form.bbsuser.focus();
    		return false;
  	}
    if (form.password.value=="")
    	{
    		alert("请填写密码！");
    		form.password.focus();
    		return false;
  	}
return true;
	}
//-->
</script>
<script language=javascript src="js/resetcode.js"></script>
<body leftmargin="8" topmargin="0">
<%if request.cookies("ftbbstype")=1 then%>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="16%" height="70" class="bannerbg"><div align="center"><img src="images/tmlogo.gif" width="112" height="50"></div></td>
    <td width="84%" class="bannerbg">&nbsp;</td>
  </tr>
</table>
<table cellspacing=0 cellpadding=0 width="99%" align=center border=0>
  <tbody>
    <tr> 
      <td height=1></td>
    </tr>
  </tbody>
</table>
<%end if%>
<table cellspacing=0 cellpadding=0 width="99%" align=center border=0>
  <tbody>
    <tr> 
      <td height=1></td>
    </tr>
  </tbody>
</table>
<table width="99%" border=0 align="center" cellpadding=2 cellspacing=1 class="maintbbg">
  <tbody>
   <tr> 
      <td height="25" class="f12bg" align="left">&nbsp;<%=userinfo%></td>
          </tr>
          <tr>
            
      <td height="26" class="maintbtr3">&nbsp;&gt;&gt;&gt;&gt;<a href="default.asp">论坛首页</a> 
        → 论坛登录 → 填写登录信息 </td>
          </tr>
        </tbody>
</table>
<table cellspacing=0 cellpadding=0 width="99%" align=center border=0>
  <tbody>
    <tr> 
      <td height=10></td>
    </tr>
    <tr> 
      <td height=1></td>
    </tr>
  </tbody>
</table>
<table width="99%" border="0" align="center" class="maintbbg" cellspacing="1" cellpadding="0">
  <FORM METHOD=POST ACTION="userlogin.asp" onSubmit="return check(this)">
    <tr class="maintbtr1"> 
      <td colspan="2" height="30" class="f14"> <div align="center">&nbsp;请输入您的用户名、论坛密码登录</div></td>
    </tr>
    <tr class="maintbtr3" height=25> 
      <TD width="28%" height="30"> <div align="left">&nbsp;请输入您的用户名：</div></TD>
      <TD width="72%"><INPUT TYPE="text" NAME="bbsuser" class="input" size="18"> 
        <a href="register.asp">没有注册？</a> </TD>
    </TR>
    <tr class="maintbtr3" height=25> 
      <TD height="30"> <div align="left">&nbsp;请输入您的论坛密码：</div></TD>
      <TD><INPUT TYPE="password" NAME="password" class="input" size="18">
        <a href="#" onClick="javascript:popwin('getpwd.asp?mode=1');return false">忘记论坛密码？</a></TD>
    </TR>
    <%If getcodeoff=1 and session("errorlogin")>=3 Then%>
    <tr> 
      <td class="maintbtr3" height="30"> <div align="left">&nbsp;请输入右边验证码：</div></td>
      <td height="20" class="maintbtr3"><input name=codestr id=codestr type=text size=6 maxlength=4> 
        <%response.write getcode%>
      </td>
    </tr>
    <%end if%>
    <tr class="maintbtr3" height=25> 
      <TD height="130" valign="top" class="maintbtr3"> <div align="left"><b>&nbsp;Cookies选项：<br>
          </b>&nbsp;请选择你的Cookie保存时间,下次访问可以方便输入.</div></TD>
      <TD><input name="ckies" type="radio" value="0" checked>
        不保存,关闭浏览器就失效<br> <input type="radio" name="ckies" value="1">
        保存一天的时间 <br> <input type="radio" name="ckies" value="7">
        保存一周的时间<br> <input type="radio" name="ckies" value="30">
        保存一月的时间<br> <input type="radio" name="ckies" value="365">
        保存一年的时间</TD>
    </tr>
    <tr valign="middle" class="maintbtr3" height=25> 
      <TD height="70" colspan="2" class="f14"> 
        <div align="left">&nbsp;请输入您的帐号与密码，然后点击登录按钮. 如果您没有注册,请先<a href="register.asp">注册成为会员</a>.<br>
          &nbsp;提示：您的浏览器必须支持cookie，否则将不能登录论坛.<br>
          &nbsp;注意：如果您在网吧,Cookies选项请选择不保存,关闭浏览器就失效登录.</div></TD>
    </tr>
    <tr class="maintbtr3" align=center> 
      <TD height="30" colspan=2 class="maintbtr1">
	  <input type="hidden" name="reurl" value="<%=request.serverVariables("Http_REFERER")%>">
	  <input type="hidden" name="act" value="y">
	  <input type="hidden" name="flag" value="<%=flag%>">
      <INPUT TYPE="submit" value="登录" name="" class="button"> </TD>
    </TR>
  </FORM>
</TABLE>
<!--#include file="inc/bbstail.htm" -->
</body>
</html>
<%conn.close%>