<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
function trpass(preString)
  Dim texts
  Dim seed
  Dim i,length
  prestring = trim(preString)
  length = len(preString)
  seed = length
  Randomize(length)
  texts = ""
  for i = 1 to length
    seed = int(94*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
    texts = texts & chr(seed) & chr(int(94*rnd(-seed)+32))
  next
  texts=replace(texts,"'","")
  trpass=replace(texts,chr(34),"")
end function
if request.form("B1")="提交" then
  Set Conn=Server.CreateObject("ADODB.Connection") 
  conn.open Application(ConstStr & "_connstr")
  
  sUserName=left(trim(request("name")),10)
  set rs=conn.execute("select * from user where username='"&sUserName&"'")
  if not (rs.eof or rs.bof) then
      if trpass(request("oldpass"))<>rs("passwd") then
        errtext="原密码错误！"
      else
        spass=left(trim(request("passwd")),15)
        if spass<>request("passwd2") then
          errtext="新密码与确定密码不一致！"
        elseif len(spass)<4 then
          errtext="新密码必须大于３个字符！"
        else
          set cschat=server.createobject("ffcschat.cssbchat")
          
          spass=cschat.trpass(spass)
          set cschat=nothing
          conn.execute("update user set passwd='"&spass&"' where username='"&sUserName&"'")
          errtext="成功！请记住新密码！！！"
        end if
      end if
   else
     errtext="用户名尚为注册！"
   end if
   rs.close
   set rs=nothing
   conn.close
   set conn=nothing
   response.redirect("showerr.asp?errtext="&errText)
else%>
<head>
<link rel="stylesheet" type="text/css" href="chat.css">
<style>p{margin-left:10px;margin-right:20px;margin-top:5px;margin-bottom:0px}</style>
</head>

<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=0 topmargin=0 >   
<table height=100% width=100% ><tr><td align=center valign=center>
<table align=center cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
  <tr><td class=navy1>老版本密码转换</td>
  <form method="POST" action="chpasswd.asp">
  <tr><td><table><tr><td style="text-align:left;line-height:200%">
    <p>用户名：<input type="text" name="name" maxlength="10" size="10"><br>
    原密码：<input type="password" name="oldpass" maxlength="10" size="10"><br>
    新密码：<input type="password" name="passwd" maxlength="15" size="10"><br>
    确　认：<input type="password" name="passwd2" maxlength="15" size="10">
    <td width=250><font color=red>聊天室系统升级，由此给你造成的不便，请原谅！</font>老版本的密码转换为新的密码格式，新密码必须大于４个字符，密码字符只能使用ASCII码字符(不能使用汉字)，否则会造成用户名不可用！</table>
  <tr><td align=center>           
   <p><input type="submit" class=navy1 value="提交" name="B1">    
   <input class=navy1 type="reset" value="复原" name="B2"></P>           
   <br><p>[<a href="javascript:history.go(-1);">返 回</a>]</tr></form>           
</table></tr></table>           
</body>              
<%end if%>

























































































