Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD: IPGate for v3.4
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 26

Mikael
Starting Member

36 Posts

Posted - 31 October 2002 :  15:37:43  Show Profile
Alex,

The header error I mentioned before was caused by the html tag you have in the beginning of the admin_ipgate, You need to make sure that no HTML is written prior to doing a response.redirect...!!

Now I will start testing the Mod, thanks Alex!
Go to Top of Page

ZeroAvengerX
Starting Member

USA
48 Posts

Posted - 31 October 2002 :  16:17:06  Show Profile  Visit ZeroAvengerX's Homepage  Send ZeroAvengerX an AOL message  Send ZeroAvengerX a Yahoo! Message
8.0 beta - i am having problems with inc_ipgate.asp i try loading the test page ipgate_test.asp and i get this error

quote:
Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/forum/inc_ipgate.asp, line 116


and i have copied the code for it here so someone can correct my wrongness - i didnt modify it at all from the original way i had received it

quote:
<%
'#################################################################################
'## Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################

'#################################################################################
'## NET IPGATE v0.8.0 BETA by alex042@picme.net (c)Aug 2002
'#################################################################################


'---------------- Set These Variables ----------------

REDIRECT_BAN="ipgate_banned.asp"
REDIRECT_LCK="ipgate_lockdown.asp"
REDIRECT_NOA="ipgate_noaccess.asp"

'----------- Uncomment below for Snitz 3.4 -----------



'---- Uncomment below for standalone application -----



'------------ DO NOT EDIT BELOW THIS LINE ------------

'do script if ip logging or banning is on, otherwise ignore script
if StrIPGateBan > 0 or StrIPGateLog > 0 then

temp = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If temp<>"" Then
userip = temp
Else
userip = Request.ServerVariables("REMOTE_ADDR")
End If

userhost=request.servervariables("REMOTE_HOST")
'referer=Request.ServerVariables("HTTP_REFERER")
pagereq=Request.ServerVariables("Path_Info")
userdate=DateToStr(strForumTimeAdjust)

Select Case StrIPGateBan
Case 0

Select Case StrIPGateLog
Case 0 'no ban - no log
Case 1 'no ban - do log
Call logip()
end select

Case 1

Select Case StrIPGateLog
Case 0 'do ban - no log
Call banip()
Case 1 'do ban - do log
Call logip()
Call banip()
end select

end select

end if



function logip()

Set rs1 = Server.CreateObject("ADODB.Recordset")

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_BEGINDATE"
StrSql = StrSql & " AND '" & userdate & "' <= IPLIST_ENDDATE )"

rs1.Open StrSql, strConnString

if (not rs1.eof and not rs1.bof) or (StrIPGateCok <> 0 and Request.Cookies("IPGate") <> "") then 'check for db ips & user cookies

Set rs3 = Server.CreateObject("ADODB.Recordset")
StrSql = "INSERT into " & strTablePrefix & "IPLOG (IPLOG_MEMBERID, IPLOG_IP, IPLOG_PATHINFO, IPLOG_DATE) "
StrSql = StrSql & "values ('" & strDBNTUserName & "','" & userip & "','" & pagereq & "','" & userdate & "')"
rs3.Open StrSql, strConnString
if rs3.State = 1 then rs3.Close
set rs3 = nothing

else
rs1.close

end if

Case 1 'log all ips
StrSql = "INSERT into " & strTablePrefix & "IPLOG (IPLOG_MEMBERID, IPLOG_IP, IPLOG_PATHINFO, IPLOG_DATE) "
StrSql = StrSql & "values ('" & strDBNTUserName & "','" & userip & "','" & pagereq & "','" & userdate & "')"
rs1.Open StrSql, strConnString

end select

if rs1.State = 1 then rs1.Close
set rs1 = nothing

end function


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 instr('" & userip & "', IPLIST_STARTIP) <> 0" 'find matching ranges
StrSql = StrSql & " OR '" & strDBNTUserName & "' = IPLIST_MEMBERID" 'find matching members
StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_BEGINDATE"
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 and 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"
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



sub banned ()
Select Case StrIPGateMet
Case 0
response.write "<p align=center><b>" & StrIPGateMsg & "</b></p>"
response.end
Case 1
Response.Redirect REDIRECT_BAN
end select
end sub

sub lockdown ()
Select Case StrIPGateMet
Case 0
response.write "<p align=center><b>" & StrIPGateMsg & "</b></p>"
response.end
Case 1
Response.Redirect REDIRECT_LCK
end select
end sub

sub noaccess ()
Select Case StrIPGateMet
Case 0
response.write "<p align=center><b>" & StrIPGateMsg & "</b></p>"
response.end
Case 1
Response.Redirect REDIRECT_NOA
end select
end sub

%>


someone please correct me
Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 31 October 2002 :  22:07:53  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
quote:
i try loading the test page ipgate_test.asp and i get this error


There are some bug fixes posted a few posts up that should fix this and some other bugs. Several things changed between this and the last version and some things were missed. Check a few posts up.
Go to Top of Page

ZeroAvengerX
Starting Member

USA
48 Posts

Posted - 31 October 2002 :  22:54:43  Show Profile  Visit ZeroAvengerX's Homepage  Send ZeroAvengerX an AOL message  Send ZeroAvengerX a Yahoo! Message
i tried the posts above, they didnt seem to work...
i donno what to do
Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 31 October 2002 :  23:31:52  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
quote:
i tried the posts above, they didnt seem to work...


You didn't go back far enough. That fix is on the end of page 4. Basically change BEGINDATE to STARTDATE and change an 'and' to an '&'.

I've also posted the link to the older version that doesn't have all of the features but doesn't have these bugs either.


Edited by - alex042 on 31 October 2002 23:33:27
Go to Top of Page

CodeName
Junior Member

296 Posts

Posted - 01 November 2002 :  17:24:48  Show Profile
So How many bug has 8.0 beta ?

And good work alex042
Go to Top of Page

tomasalsbro
Average Member

Sweden
818 Posts

Posted - 07 November 2002 :  17:14:47  Show Profile  Visit tomasalsbro's Homepage
Must be blind - can't find the download

Tomas

!-Keep distance in traffic-!
www.whiplashinfo.se
Go to Top of Page

tomasalsbro
Average Member

Sweden
818 Posts

Posted - 14 December 2002 :  08:33:42  Show Profile  Visit tomasalsbro's Homepage
!-- Bump --!

!-Keep distance in traffic-!
www.whiplashinfo.se
Go to Top of Page

Mikael
Starting Member

36 Posts

Posted - 15 December 2002 :  05:08:58  Show Profile
The download link is in the first message in this thread, look at version history and click on the version v0.8.0 BETA
Go to Top of Page

supergaillard
Starting Member

4 Posts

Posted - 15 December 2002 :  19:54:05  Show Profile
quote:
Originally posted by Rob.B

Is this mod compatible with MySQL??


You should replace in admin_ipgate.asp around line 160 :


strSql = "SELECT TOP 500 * from " & strTablePrefix & "IPLOG order by IPLOG_ID desc"

by

if strDBType = "mysql" then 'MySql specific code
strSql = "SELECT * from " & strTablePrefix & "IPLOG order by IPLOG_ID desc LIMIT 0,500"
else
strSql = "SELECT TOP 500 * from " & strTablePrefix & "IPLOG order by IPLOG_ID desc"
end if




There is also a problem at line 113 and 157
We should replace :

StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_BEGINDATE"

by

StrSql = StrSql & ") AND ('" & userdate & "' >= IPLIST_STARTDATE"



At line 166 replace :

if (StrIPGateCok <> 0 and Request.Cookies("IPGate") = 1) then 'check for banned user cookie

by

if (StrIPGateCok <> 0 and Request.Cookies("IPGate") <> "") then 'check for banned user cookie


Edited by - supergaillard on 16 December 2002 08:19:23
Go to Top of Page

CodeName
Junior Member

296 Posts

Posted - 16 December 2002 :  07:31:27  Show Profile
How we can see the TOPIC ID in the log ?
Go to Top of Page

supergaillard
Starting Member

4 Posts

Posted - 16 December 2002 :  07:58:55  Show Profile
quote:
Originally posted by CodeName

How we can see the TOPIC ID in the log ?



Around the line 73 in inc_ipgate.asp

Replace
pagereq=Request.ServerVariables("Path_Info")

by

pagereq=Request.ServerVariables("Path_Info")&"?"& Request.ServerVariables("QUERY_STRING")
Go to Top of Page

CodeName
Junior Member

296 Posts

Posted - 16 December 2002 :  12:24:25  Show Profile
Thanks Man its worked

and

Can we take Referer Log from IPGate is it possible ?

Edited by - CodeName on 16 December 2002 12:25:27
Go to Top of Page

tomasalsbro
Average Member

Sweden
818 Posts

Posted - 17 December 2002 :  01:32:52  Show Profile  Visit tomasalsbro's Homepage
quote:
Originally posted by Mikael

The download link is in the first message in this thread, look at version history and click on the version v0.8.0 BETA





Tomas

!-Keep distance in traffic-!
www.whiplashinfo.se
Go to Top of Page

CodeName
Junior Member

296 Posts

Posted - 17 December 2002 :  09:45:02  Show Profile
At Where We have to add include file in inc_header.asp ?

I added between login / logout code but IPgate dont show the Member Name..
Go to Top of Page
Page: of 26 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07