<%Response.Buffer=true response.expires=0 myid=Session("myid") myname=Session("myname") if myid="" or myname="" then response.end application.lock call get_guests if myname<>guests(myid,0) or Session("mytemp")<>guests(myid,1) then response.end my_level=guests(myid,4) if my_level<(-1*guests(myid,9)) then my_level=-1*guests(myid,9) call get_votes if (votes(0)<>0 and votes(1)=myname) then my_level=1 cmdYes=request("cmdYes") if cmdYes<>"解锁" and cmdYes<>"封锁" then response.end ip=request("ip") set rsparam=conn.execute("select * from param") if guests(myid,4)=rsparam("superlevel") then myname="聊天室管理员" forwhat=left(trdb(request("forwhat")),100) if IsNumeric(request("howlong")) then howlong=cint(request("howlong"))*60 if howlong<60 then howlong=60 else howlong=60 end if ipnum=replace(replace(replace(replace(replace(ip,".",""),"*",""),"?",""),"%",""),"_","") if not IsNumeric(ipnum) then errText="IP地址格式错误!" elseif len(ip)>16 then errText="有这么长的IP地址吗?!" elseif len(ipnum)<4 then errText="IP地址至少包含4位数字!" elseif my_level-rsparam("llockip")<0 then errText="你暂时还没有"&cmdYes&"IP的权力!" elseif forwhat="" then errText="不注明原因,你想乱来啊?" end if if errText="" then if cmdYes="解锁" then sql="SELECT * FROM ip_lock WHERE ip='"&ip&"'" set Rs=conn.Execute(sql) if Rs.eof or Rs.bof then errText="你想解锁ip"&ip&",但"&ip&"并没有被封锁!" else conn.Execute("delete from ip_lock WHERE ip='"&ip&"'") end if elseif cmdYes="封锁" then ip=replace(replace(ip,"*","%"),"?","_") out_time=dateAdd("n",howlong,now()) conn.Execute("DELETE FROM ip_lock WHERE ip='"&ip&"'") conn.Execute("INSERT INTO ip_lock (ip,end_time) VALUES ('"&ip&"','"&out_time&"')") end if end if if errText="" then conn.Execute("INSERT INTO record (occ_env,occ_time,for_what) VALUES ('"&myname&" "&cmdYes&"了IP("&ip&")','"&now()&"','"&forwhat&"')") 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)="'【封IP】##"&cmdYes&"了IP("&ip&")!','"&myname&"','大家',0,'#3366cc','green',-2,'"&time()&"'," guests(myid,11)=now() call put_guests call put_says errText="你成功地"&cmdYes&"了IP("&ip&")!" end if call echoerr(errText,"superuser.asp") application.unlock%>