<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock
set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
application.unlock
if my_level=0 then
  set cschat=nothing
  response.end
end if
myname=cschat.myname

Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")
set Rs=conn.execute("select * from user where username='"&myname&"'")
if Rs.eof or Rs.bof then
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  response.end
end if

if request("B1")="提交" then
  cschat.FilterStr = Application(ConstStr & "_saysfilterstr")
  errText=""
  if trim(rs("remand"))<>"" and trim(rs("answer"))<>"" then
    old_answer=left(cschat.trdb(request("old_answer")),100)
    if trim(rs("answer"))<>trim(old_answer) then errText="用户已设定密码保护，必须输入正确的原密码回答才可以修改！"
  end if
  if errText="" then
    answer=left(cschat.trdb(request("answer")),100)
    remand=left(cschat.trdb(request("remand")),100)
    if answer="" or remand="" then
      errText="密码提示和密码回答不能为空！"
    else
      conn.Execute("UPDATE user SET remand='"&remand&"',answer='"&answer&"' WHERE username='"&myname&"'")
      errText="你成功设定用户密码保护，请牢记密码回答！"
    end if
  end if
  response.redirect("showerr.asp?errtext="&errText)
else%>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'><META content="text/html; charset=gb2312" http-equiv=content-type>
<link rel="stylesheet" type="text/css" href="chat.css">
<style>p{color:#990000;text-align:left;margin-left:10px;margin-right:20px;margin-top:5px;margin-bottom:5px}</style>
<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=3 >
  <table cellspacing=0 cellpadding=0 align=center width=90% height=100%>
  <tr><td valign=center>
  <table width=400 cellspacing=0 cellpadding=0 style="border:'1px solid navy'">
  <tr><td class=navy2>设定用户密码保护</td>
  <form action=usersetprotectpass.asp method=post><tr><td><p>
<%if trim(rs("remand"))<>"" and trim(rs("answer"))<>"" then%>
  原密码提问:<%=rs("remand")%></p><p>
  原密码回答:<input type=text name=old_answer maxlength=100 size=30></p><p>
<%end if%>
 　密码提问:<input type=text name=remand maxlength=100 size=30 value='<%=rs("remand")%>'></p><p>
 　密码回答:<input type=text name=answer maxlength=100 size=30></p><p>
<tr><td><p><center><center><input type="submit" name="B1" value="提交" class=navy1>
<input type="reset" name="cmdCancel" value="重置" class=navy1>
<input type="reset" name="cmdCancel" value="取消" onclick='window.close()' class=navy1><center>
</center>
</p></td></tr></form>
</table></table></body></html>
<%end if
set cschat=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing%>




























































































