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

votes=application(ConstStr & "_votes")
if (votes(0)<>0 and votes(1)=myname) then my_level=1

cschat.FilterStr = Application(ConstStr & "_saysfilterstr")

forwhat=left(cschat.trdb(request("forwhat")),40)

if my_level=0 then
  errText="你还没有登录到聊天室！"
elseif my_level-application(ConstStr & "_l_lockuser")<0 then
  errText="你暂时还没有此高级管理权力！"
elseif forwhat="" then
  errText="不注明原因，你想乱来啊？"
else
  Set Conn=Server.CreateObject("ADODB.Connection")
  conn.open Application(ConstStr & "_connstr")
  towho=request("username")
  sql="SELECT * FROM user WHERE username='"&towho&"'"
  set Rs=conn.Execute(sql)
  if Rs.eof or Rs.bof then
    errText="用户"&towho&"还没有注册呢！"
  else
    if rs("out_info")<6 then
      errText="用户"&towho&"的帐号并没有被冻结！"
    elseif rs("out_info")=7 and my_level-application(ConstStr & "_l_colduser")<0 then
      errText="用户"&towho&"的帐号被永久冻结，你权力不够！"
    else
      room_name=cschat.GetListValue(Application(ConstStr & "_room_list"), room_id, 0)
      conn.Execute("UPDATE user SET out_info=1 WHERE username='"&towho&"'")
      ipstr=rs("last_ip")
      if my_level-application(ConstStr & "_superlevel")=0 then myname="管理员"

      occ_env=room_name&">"&myname&">"&Request.ServerVariables("REMOTE_ADDR")&">"&towho&">"&ipstr&">"&forwhat
      conn.Execute("INSERT INTO record (stype,occ_time,occ_env) VALUES (12,'"&now()&"','"&occ_env&">解除对用户%%的冻结。')")
      
      say_mess=split(application(ConstStr & "_lifeusershow"),"::")
      say_mess(0)=replace(say_mess(0),"$F",forwhat)
says = Application(ConstStr & "_says")
current = Application(ConstStr & "_current")
      cschat.newsay myname,towho,0,room_id,say_mess(0),say_mess(1),say_mess(2),-2,says,current
Application(ConstStr & "_says") = says
Application(ConstStr & "_current") = current

      errText="你成功地解冻了用户(<font color=green>"&towho&"</font>)的帐号!"
    end if
  end if
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
end if
set cschat=nothing
application.unlock
response.redirect("showerr.asp?errtext="&ErrText)
%>
