<!--#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"))
myname=cschat.myname
application.unlock

if my_level=0 then
 set cschat=nothing
 response.end
end if

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
  set cschat=nothing
  response.end
end if

if rs("passwd")<>cschat.trpass(request("oldpass")) then
  errText="原密码错误！"
elseif request("sPass1")<>request("sPass2") then
  errText="新密码和确认密码不一致！"
elseif request("sPass1")=myname then
  errText="新密码和用户名相同！"
elseif trim(request("sPass1"))="" then
  errText="新密码为空！"
else
  conn.execute("UPDATE user SET passwd='"&cschat.trpass(request("sPass1"))&"' WHERE username='"&myname&"'")
  errText="你成功的修改了密码！"
end if
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><body>"
Response.Write "<script Language=JavaScript>"
Response.Write "parent.chcolor();alert('" & errText & "');history.go(-1);"
Response.Write "</script>"
rs.close
set rs=nothing
conn.close
set conn=nothing
set cschat=nothing%>




























































































