<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp" -->

<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
<%
mode=request.querystring("mode")
if mode=1 then
%>
<br>
<form name="form1" method="post" action="getpwd.asp?mode=2">
  <table width="100%" border="0" align="center">
    <tr align="center"> 
      <td height="30"><font size="2">取回密码请输入你的用户名</font></td>
    </tr>
    <tr align="center">
      <td height="30">用户名：
<input type="text" name="bbsuser" size="10">
        <input type="submit" name="Submit2" value="提交">
      </td>
    </tr>
  </table>
</form>
<%end if%>
<%if mode=2 then
bbsuser=trim(request.form("bbsuser"))
sql="select * from clubuser where clubuser_name='"&bbsuser&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
if rs.eof then
%>
<div align=center>不存在该用户！<BR><BR>
  <A HREF="<%=request.servervariables("http_referer")%>">[返回]</A> <a href="javascript:window.close()">[关闭窗口]</a> 
</div>
<%else
session("bbsuser_pwd")=rs("clubuser_name")
%>
<form name="form1" method="post" action="getpwd.asp?mode=3">

  <table width="100%" border="0" align="center">
    <TR> 
      <TD>
        <div align="right">您的问题： </div>
      </TD>
      <TD><FONT COLOR="red"><%=rs("clubuser_question")%></FONT></TD>
    </TR>
    <TR> 
      <TD width="54%"><div align="right">问题的答案： </div></TD>
      <TD width="46%"><input type="text" name="answer" size="10"> </TD>
    </TR>
    <TR> 
      <TD colspan="2"> <div align="center"> 
          <input type="submit" name="Submit" value="提交">
        </div></TD>
    </TR>
  </TABLE>
</form>

<%end if%>
<%end if%>

<%if mode=3 then
answer=trim(request.form("answer"))
sql="select * from clubuser where clubuser_name='"&session("bbsuser_pwd")&"' and clubuser_answer='"&answer&"' and bbsmanager=0 and bbsadmin=0"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
if rs.eof then
%>
<div align=center>答案错误，请重新输入！<BR><BR>
<A HREF="javascript:window.history.back()">[返回]</A>
</div>
<%else%>
<%
pwd="123456"
str="update clubuser set clubuser_password='"&md5(pwd)&"' where clubuser_name='"&session("bbsuser_pwd")&"'"
conn.execute str
%>
<div align=center>您的密码已被设为默认密码：<font color="#FF0000">123456</font><BR>
  <BR>
<A HREF="javascript:window.close()">[关闭窗口]</A>
</div>
<%end if%>
<%end if%>
<%conn.close%>