Manage user kick file admin/admin.asp
<%
User=request.form ("User")
Adbut=request.form ("Kaction")
Whoto=request.form ("Hdish")
%><meta http-equiv= "Refresh" content= "4; Url=.. /refresh.asp?user=<% =user%> ">
<%
Chatdata=application ("Chatdata")
Chatcomm=application ("Chatcomm")
Chatpoin=application ("Chatpoin")
Sendid=finduser (user)
If Sendid<51 and Chatdata (sendid,1) =request.servervariables ("REMOTE_ADDR") Then
If session ("admlevel") = "9" Then
Reciid=finduser (Whoto)
Select Case Adbut
Case "SIP"
If Reciid<51 Then
Dispstr=right ("0" &time,8) & ", System, 0," &user& ", ff0000,0," &whoto& "IP address is" &chatdata "( whotoid,1)
Else
Dispstr=right ("0" &time,8) & ", System, 0," &user& ", ff0000,0," &whoto& "not in this chat room"
End If
%><script language= ' JavaScript ' >
Parent.comm=new Array (' <% =dispstr%> ');
Parent.writecomm (); </script><%
Case "Kip"
If reciid<51 and Sendid<>reciid then
Kicklist=application ("Kicklist")
If InStr (Kicklist, ", '" &chatdata (reciid,1) & "") <1 Then
kicklist=kicklist& "," "&chatdata (reciid,1) &" "
Chatpoin=chatpoin+1 MoD 50
Chatcomm (Chatpoin) = "'" &right ("0" &time,8) & ", System, 0, everyone, ff0000,0," &whoto& "IP was kicked out of the chat room by the administrator" "
Application.Lock
Application ("Kicklist") =kicklist
Application ("Chatpoin") =chatpoin
Application ("Chatcomm") =chatcomm
Application.UnLock
End If
End If
Case "Name"
If reciid<51 and Sendid<>reciid then
Kicklist=application ("Kicklist")
If InStr (Kicklist, ", ' #" &chatdata (reciid,0) & "") <1 Then
kicklist=kicklist& ", ' #" &chatdata (reciid,0) & ""
Chatpoin=chatpoin+1 MoD 50
Tmp=chatdata (reciid,0)
Chatdata (reciid,0) = ""
Chatdata (reciid,1) = ""
For I=0 to 50
Chatdata (i,4) = (chatdata (i,4) mod 4) # +4
Next
Chatcomm (Chatpoin) = "'" &right ("0" &time,8) & ", System, 0, everyone, ff0000,0," &whoto& "was kicked out of the chat room by the admin" "
Application.Lock
Application ("Kicklist") =kicklist
Application ("Chatpoin") =chatpoin
Application ("Chatcomm") =chatcomm
Application ("Chatdata") =chatdata
Application ("Onliuser") =replace (Application ("Onliuser"), ", '" &tmp& "", "")
Application.UnLock
End If
End If
End Select
End If
End If
function Finduser (fuser)
reval=51
For I=0 to 50
If Chatdata (i,0) =fuser Then
Reval=i
Exit For
End If
Next
Finduser=reval
End Function
%>