<!--#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-application(ConstStr & "_superlevel")<>0 then
  response.redirect("showerr.asp?errtext=请问你是谁呀？")
  application.unlock
  set cschat=nothing
  response.end
end if
myname=cschat.myname
room_id=cschat.room_id
room_name=cschat.GetListValue(Application(ConstStr & "_room_list"), room_id, 0)
set cschat=nothing
application.unlock

username=request("name")

if request("action")="ok" then
 auto_update=1
 savedstr="允许自动升级"
else
 auto_update=0
 savedstr="禁止自动升级"
end if

  Set Conn=Server.CreateObject("ADODB.Connection")
  conn.open Application( ConstStr & "_connstr")
  set rs=conn.execute("select * from user where username='"&username&"'")
  if rs.eof or rs.bof then
    response.redirect("showerr.asp?errtext=该用户还没有注册！")
    rs.close
    set rs=nothing
    conn.close
    Set conn=nothing
    response.end
  elseif rs("user_level")-application( ConstStr & "_superlevel")=0 then
    response.redirect("showerr.asp?errtext=该用户不能被修改属性！")
    rs.close
    set rs=nothing
    conn.close
    Set conn=nothing
    response.end
  end if
  conn.execute("update user set auto_update="&auto_update&" where username='"&username&"'")
  occ_env=room_name&">"&myname&">"&Request.ServerVariables("REMOTE_ADDR")&">"&username&">"&savedstr&">此处只作记录>修改%%的属性"
  conn.Execute("INSERT INTO record (stype,occ_time,occ_env) VALUES (58,'"&now()&"','"&occ_env&"')")
  rs.close
  set rs=nothing
  conn.close
  Set conn=nothing
  response.redirect("showerr.asp?errtext=你成功的修改了聊友<u>"&username&"</u>的属性["&savedstr&"]！")
%>














