<!--#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
myname=cschat.myname
set cschat=nothing

if my_level=0 then
  response.redirect("showerr.asp")  
  response.end
end if

if my_level-application( ConstStr & "_l_keepuser")<0 then response.end

Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")
set Rs=conn.execute("select * from user where username='"&myname&"'")

if trim(rs("remand"))<>"" and trim(rs("answer"))<>"" then
  if rs("saved")=0 then
    saved=1
    errText="你修改自己为保留用户！"
  else
    saved=0
    errText="你取消了自己的用户保留资格！"
  end if
  if my_level-Application( ConstStr & "_superlevel")=0 and saved=0 then
    errText="你不能取消自己的用户保留资格！"
  else
    conn.execute("update user set saved="&saved&" where username='"&myname&"'")
  end if
else
  errText="必须先设定密码保护才能够设定自己为保留用户！"
end if

conn.close
set conn=nothing
%>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<SCRIPT language=JavaScript>
parent.addsay(-1,'【系统】<%=errText%>！',parent.myname,'大家',0,'black','990099',-2,parent.gettimestr())
</script>