Author |
Topic |
Scutter
Starting Member
13 Posts |
Posted - 10 February 2003 : 14:18:03
|
ah nm, sorted it, it works when I switch lockdowns off |
|
|
Munkey
Starting Member
27 Posts |
Posted - 10 February 2003 : 14:46:36
|
quote: Originally posted by Chuck McB
Banning IP Range: have a look at the link I posted above (previous page) to a possible fix
Cokkies error: can you post a link to the lines arround the error you're getting (I rember there was a problem with Type mismatch: 'rs' but I can't rember what it was.
Hey Chuck,
I tried your fix after I posted, the range still dosen't work, only the single full IP will work.
As for the Cookie Error, here are the lines (Line 178 marked in red) :
function banip()
If mLev < 4 then
Set rs2 = Server.CreateObject("ADODB.Recordset")
StrSql = "SELECT IPLIST_STARTDATE, IPLIST_ENDDATE, IPLIST_STATUS, IPLIST_DBPAGEKEY "
StrSql = StrSql & "FROM " & strTablePrefix & "IPLIST"
StrSql = StrSql & " WHERE ('" & userip & "' = IPLIST_STARTIP" 'find matching ips
StrSql = StrSql & " OR '" & userhost & "' = IPLIST_STARTIP" 'find matching hosts
StrSql = StrSql & " OR '" & userip & "' NOT LIKE '%" & IPLIST_STARTIP & "%'" 'find matching ranges
StrSql = StrSql & " OR '" & strDBNTUserName & "' = IPLIST_MEMBERID" 'find matching members
StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_STARTDATE"
StrSql = StrSql & " AND '" & userdate & "' <= IPLIST_ENDDATE )"
rs2.Open StrSql, strConnString
Select Case StrIPGateLck 'check for lockdown
Case 0 'no Lockdown
if rs2.eof or rs2.bof then 'no ip found in db
if (StrIPGateCok <> 0 & Request.Cookies("IPGate") = 1) then 'check for banned user cookie
Call banned()
end if
if pagekey <>"" then 'check for special access page
Call noaccess()
end if
else
Select Case rs2("IPLIST_STATUS")
Case 0 'banned ip
If StrIPGateCok <> 0 then 'set banned user cookie
Response.Cookies("IPGate") = "1"
Line 178 --------> Response.Cookies("IPGate").Expires = ChkDate(rs("IPLIST_ENDDATE"), " " ,false)
end if
Call banned()
Case 1 'watched ip
If StrIPGateCok <> 0 then 'set watched user cookie
Response.Cookies("IPGate") = "0"
Response.Cookies("IPGate").Expires = ChkDate(rs("IPLIST_ENDDATE"), " " ,false)
end if
if pagekey <> "" and pagekey <> rs2("IPLIST_DBPAGEKEY") then
Call noaccess()
end if
Case 2 'special access ip
if pagekey <> "" and pagekey <> rs2("IPLIST_DBPAGEKEY") then
Call noaccess()
end if
end select
end if
Case 1 'do LOCKDOWN
Select Case rs2("IPLIST_STATUS")
Case 0, 1
Call lockdown()
Case 2 'special access ip
if pagekey <> "" and pagekey <> rs2("IPLIST_DBPAGEKEY") then
Call noaccess()
end if
end select
end select
rs2.close
set rs2 = nothing
end if
end function |
Edited by - Munkey on 10 February 2003 14:47:28 |
|
|
Chuck McB
Junior Member
WooYay
196 Posts |
Posted - 10 February 2003 : 18:31:11
|
try:
Response.Cookies("IPGate").Expires = ChkDate(rs2("IPLIST_ENDDATE"), " " ,false)
|
|
|
Munkey
Starting Member
27 Posts |
Posted - 11 February 2003 : 11:59:40
|
quote: Originally posted by Chuck McB
try:
Response.Cookies("IPGate").Expires = ChkDate(rs2("IPLIST_ENDDATE"), " " ,false)
That took away the error, but the Cookies option dosen't actually add a cookie for ban, and if does, its not working. Oh well, it would be nice to get atleast the IP-Range working. |
|
|
Chuck McB
Junior Member
WooYay
196 Posts |
Posted - 11 February 2003 : 13:37:11
|
The cookie ban works for me.
Here's a copy of my inc_ipgate.asp
It incldes a line that means that IP ranges are logged but using the same line in the banip function doesn't work. |
|
|
arnold
Starting Member
27 Posts |
Posted - 14 February 2003 : 09:41:37
|
quote: Originally posted by Chuck McB
don't think there is any work being done on it (that's why I'm trying to get help with my modified code)
That's a pity; was already waiting for months and months. Is there an alternative? Perhaps less complete but working properly? |
|
|
schef
Junior Member
USA
164 Posts |
Posted - 14 February 2003 : 12:23:38
|
I couldn't get this mod to run correctly, but I did find this one, works great, but doesnt do cookies. I set it to be included into my pages. The top segment will ban one specific IP while the 2 bottom segments are set for a range.
<%
Select Case Request.ServerVariables("REMOTE_ADDR")
Case "209.123.123.42","192.168.10.149"
Response.Redirect "ipgate_banned.asp"
Case Else
End Select
strURL = Request.ServerVariables("REMOTE_ADDR")
if left(strURL,12) = "205.123.123." then response.redirect "ipgate_banned.asp"
strURL = Request.ServerVariables("REMOTE_ADDR")
if left(strURL,8) = "152.123." then response.redirect "ipgate_banned.asp"
%>
|
ATV Outdoors |
|
|
schef
Junior Member
USA
164 Posts |
Posted - 14 February 2003 : 12:27:14
|
quote: Originally posted by Chuck McB
The cookie ban works for me.
Here's a copy of my inc_ipgate.asp
It incldes a line that means that IP ranges are logged but using the same line in the banip function doesn't work.
THAT FIXED MY PROBLEM!!!! woooooooooooow... I have been looking at it for a while and this did it. It works now after I increase the expire date. Thanks!! |
ATV Outdoors |
|
|
CodeName
Junior Member
296 Posts |
Posted - 18 February 2003 : 04:33:09
|
Well ,
Somebody can tell with example that how to use IP ban..
What is it for That `Page Key` ? If I put that empty , I cant open My forums.. :-/
Somebody Can tell with Example Please? |
|
|
Chuck McB
Junior Member
WooYay
196 Posts |
Posted - 18 February 2003 : 06:27:59
|
CodeName: post in the Help: MOD Implementation I'll answer you there. |
|
|
ralphb
Starting Member
USA
1 Posts |
Posted - 13 March 2003 : 20:46:45
|
quote: Originally posted by alex042
I changed quite a few things between the versions and it looks like I missed some things.
inc_ipgate.asp
line 113:
StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_STARTDATE"
line 157:
StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_STARTDATE"
line 167:
if (StrIPGateCok <> 0 & Request.Cookies("IPGate") = 1) then 'check for banned user cookie
The include may also have to be moved down farther, maybe around where the group categories are after all of the login information.
hmmm...I've tried posting the changes listed to get this to work and I still get the same error:
Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E14) 'instr' is not a recognized function name. /forum/inc_ipgate.asp, line 117
Here's the current code I have:
Select Case StrIPGateTyp
Case 0 'log db ips only
StrSql = "SELECT IPLIST_STARTDATE, IPLIST_ENDDATE, IPLIST_STATUS, IPLIST_DBPAGEKEY "
StrSql = StrSql & "FROM " & strTablePrefix & "IPLIST"
StrSql = StrSql & " WHERE ('" & userip & "' = IPLIST_STARTIP" 'find matching ips
StrSql = StrSql & " OR '" & userhost & "' = IPLIST_STARTIP" 'find matching hosts
StrSql = StrSql & " OR instr('" & userip & "', IPLIST_STARTIP) <> 0" 'find matching ranges
StrSql = StrSql & " OR '" & strDBNTUserName & "' = IPLIST_MEMBERID" 'find matching members
StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_STARTDATE"
StrSql = StrSql & " AND '" & userdate & "' <= IPLIST_ENDDATE )"
Can someone please post the correct and complete SQL for this MOD?
Thanks, Ralph |
Ralph Brenner Triffid |
|
|
Chuck McB
Junior Member
WooYay
196 Posts |
|
Cyberjunkie
Junior Member
111 Posts |
Posted - 22 March 2003 : 15:13:19
|
Hi this Mod was much much easier to install then I thought. The installation proces went smoothly no problems. BUT now that its installed, I cant seem to make it work..hmmm. In the Admin page for the MOD, I cant seem to make it remember the IP configuration that I have done. F.ex. I choose Yes to Banning, but when I press Submit new config then all my configuration is lost and it says as default No to everything. Plz help!! |
|
|
Orakio Rob
Starting Member
11 Posts |
Posted - 25 March 2003 : 11:58:02
|
Nice MOD, my only complaint is the readme file, the mod is easy to install, but the read me is confusing...
Nice mod, Alex, thanks. But is there a way to ban guys that have dhcp? |
|
|
Jace
Starting Member
24 Posts |
Posted - 25 March 2003 : 19:00:54
|
Hi guys.. Simple question..
Does this mod, logs ALL ip which connected to the forum, from it's installation? Everlasting logs?
It's possible? Maybe with another mod.. I'm looking for this fature..
Tnks |
|
|
Topic |
|