%Response.Buffer=true
response.expires=0
myid=Session("myid")
myname=Session("myname")
if myid="" or myname="" then response.end
application.lock
call get_guests
call get_maxuser
if myname<>guests(myid,0) or Session("mytemp")<>guests(myid,1) then response.end
set rs1=conn.execute("select room_owner from room where ID="&guests(myid,5))
my_level=guests(myid,4)
if my_level<(-1*guests(myid,9)) then my_level=-1*guests(myid,9)
if myname=rs1("room_owner") and my_level<7 then my_level=7
call get_votes
if (votes(0)<>0 and votes(1)=myname) then my_level=1
cmdYes=request("cmdYes")
if cmdYes<>"踢人" and cmdYes<>"封IP" then response.end
selwho=request("selwho")
EXflag=false
for i=0 to MaxUser
if guests(i,0)=selwho and guests(i,5)=guests(myid,5) then
EXflag=true
towho_level=guests(i,4)
towho_id=i
exit for
end if
next
set rsparam=conn.execute("select * from param")
if guests(myid,4)=rsparam("superlevel") then myname="聊天室管理员"
if (my_level-towho_level)<1 then
call echoerr("聊天室不允许对高级或同级聊友行使管理权限!","online_admin.asp")
response.end
elseif (cmdYes="踢人" and my_level-rsparam("lkick")<0) or (cmdYes="封IP" and my_level-rsparam("llockip")<0) then
call echoerr("你暂时还没有"&cmdYes&"权力!","online_admin.asp")
response.end
end if
if not EXflag then
call echoerr(""&selwho&"不晓得躲到哪儿去了!","online_admin.asp")
response.end
end if
forwhat=left(trdb(request("forwhat")),40)
if forwhat="" then
errText="不注明原因,你想乱来啊?"
elseif selwho=rs1("room_owner") then
errText="人家是房主,不能如此对待人家!"
elseif selwho=myname then
errText="您想处罚自己吗?请自杀吧!"
else
sql="SELECT user_level,out_info,out_time FROM user WHERE username='" & selwho & "'"
set Rs=conn.Execute(sql)
mess="'【踢人】##提起%%的脑袋,一下子把%%摔出了聊天室!','"&myname&"','"&selwho&"',0,'#cc00cc','green',-2,'"&time()&"',"
desstr="请出了聊天室"
if not (Rs.eof or Rs.bof) then
user_level=Rs("user_level")
if cmdYes="封IP" then
desstr="的IP封锁了"
mess="'【封IP】##封锁了%%的IP("&guests(towho_id,2)&")!','"&myname&"','"&selwho&"',0,'#cc00cc','green',-2,'"&time()&"',"
out_time=dateAdd("n",60,now())
conn.Execute("DELETE FROM ip_lock WHERE ip='"&guests(towho_id,2)&"'")
conn.Execute("INSERT INTO ip_lock (ip,end_time) VALUES ('"&guests(towho_id,2)&"','"&out_time&"')")
end if
d_level=my_level-user_level+3
out_time=dateAdd("n",d_level,now())
conn.Execute("UPDATE user SET out_info=5,out_time='"&out_time&"' WHERE username='"&selwho&"'")
conn.Execute("INSERT INTO record (occ_env,occ_time,for_what) VALUES ('"&myname&" 把 "&selwho&"("&guests(towho_id,2)&") "&desstr&"','"&now()&"','"&forwhat&"')")
end if
call get_says
say_id=says(current,0)+1
current=current+1
if current>MaxTalk then current=0
says(current,0)=say_id
says(current,1)="大家"
says(current,2)="大家"
says(current,3)=false
says(current,4)=guests(myid,5)
says(current,5)=mess
guests(myid,11)=now()
guests(towho_id,0)=""
call put_guests
call put_says
errText="你成功地处罚了"&selwho&"!"
end if
call echoerr(errText,"online_admin.asp")
application.unlock%>