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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Ban IPs by IP, Range, or Country Mod Error
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 October 2013 :  14:00:14  Show Profile  Reply with Quote

I did the "Ban IPs by IP, Range, or Country" mod here and obviously the required "IP to Country" mod as well.

I am trying to ban a member from the US and having a problem. I am receiving the error message, "Not found in country IP list."

I'm wondering if the "IP to Country" list may have "USA" in it while the "Ban IPs by IP, Range, or Country" mod only had "United States of America" for me to select but that's just my unprofessional opinion.


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 19 October 2013 14:00:36

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 19 October 2013 :  14:20:18  Show Profile
I didn't include all possible methods of identifying the country (e.g., "America", "North America", "United States", "USA", "US", "U.S.A.", etc.). But if you want to ban someone registered as "US", I'll add a routine to convert all of those.

What is the member's IP address? They should ALL be included.

Edited by - Carefree on 19 October 2013 14:26:17
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 19 October 2013 :  14:33:13  Show Profile
You'll still get the error for an unknown IP address, but it will return after notifying you. Replace your "admin_ban_ips.asp" with this:


<!DOCTYPE HTML>
<%
'###############################################################################
'##
'##	              Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'##	          Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.  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 an 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:
'##
'##	          Free Software Foundation, Inc.
'##	          59 Temple Place, Suite 330
'##	          Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'##	            http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'##	             manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
Response.Charset="UTF-8"
On Error Resume Next
if intRPI = 2 then Response.Redirect	"forum.asp?FORUM_ID=2"
If mLev<4 Then
	scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
	Response.Redirect "admin_login.asp?target=" & scriptname(Ubound(scriptname))
End If
Response.Write	"			<table border=""0"" width=""100%"">" & vbNewLine & _
	"				<tr>" & vbNewLine & _
	"					<td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"					" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Banned IPs<br /></font></td>" & vbNewLine & _
	"				</tr>" & vbNewLine & _
	"			</table><br><br>" & vbNewLine
Err_IP_Start	= "You must specify the starting IP address or range."
Err_IP_End	= "You must specify the ending IP address or range."
strLead="00"
strStart="":strEnd=""
If Request("IP_START") > "" Then strStart=Request("IP_START")
If Request("IP_END") > "" Then strEnd=Request("IP_END")
If strStart > "" Then
	intSeg=0
	For i = 1 to len(strStart)
		If mid(strStart,i,1)="." Then
			intSeg=intSeg+1
			If intSeg=1 Then 
				strPart1=right(strLead&left(strStart,i-1),3)
				x=i
			End If
			If intSeg=2 Then
				strPart2=right(strLead&mid(strStart,x+1,i-x-1),3)
				y=i
			End If
			If intSeg=3 Then
				strPart3=right(strLead&mid(strStart,y+1,i-y-1),3)
				strPart4=right((strLead&mid(strStart,i+1)),3)
			End If
		End If
	Next
	strStart=strPart1&"."&strPart2&"."&strPart3&"."&strPart4
End If
If strEnd>"" Then
	intSeg=0
	For i = 1 to len(strEnd)
		If mid(strEnd,i,1)="." Then
			intSeg=intSeg+1
			If intSeg=1 Then 
				strPart1=right(strLead&left(strEnd,i-1),3)
				x=i
			End If
			If intSeg=2 Then
				strPart2=right(strLead&mid(strEnd,x+1,i-x-1),3)
				y=i
			End If
			If intSeg=3 Then
				strPart3=right(strLead&mid(strEnd,y+1,i-y-1),3)
				strPart4=right(strLead&mid(strEnd,i+1),3)
			End If
		End If
	Next
	strEnd=strPart1&"."&strPart2&"."&strPart3&"."&strPart4
End If
If Request("mode")="delete" Then 
	Dim rsDelete
	strSql = "DELETE FROM " & strTablePrefix & "BAN_IPS"
	strSql = strSql & " WHERE BAN_ID = " & Request("Ban_ID")
	my_Conn.Execute(strSql) 
	Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Deleted!" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""2; URL=admin_ban_ips.asp"">" & vbNewLine
	WriteFooter
	Response.End
End If
If Request("EditBan")="doit" Then 
	Dim rsUpdate
	strSql = "UPDATE " & strTablePrefix & "BAN_IPS"
	strSql = strSql & " Set IP_START = '" & strStart & "', IP_END='" & strEnd & "' WHERE BAN_ID = " & Request("Ban_ID")
	If Request("IP_START") = "" Then
		Response.Write	"<p align=""center""><font color=""red"" size=""1""><b>" & Err_IP_Start & "</b>" & vbNewLine &_
			"<br><br>" & vbNewLine &_
			"<a href=""javascript:history.go(-1)"">Go Back</a></font></p>"
		WriteFooter
		Response.End	
	End If
	Set rsUpdate = my_Conn.Execute(strSql)
	Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Updated!" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
	WriteFooter
	Response.End
End If
If Request("mode")="add" Then
	If Request("IP_Country")>"." Then
		strCountry=ChkString(Request("IP_Country"),"SQLString")
		If strCountry="US" or strCountry="U.S." or strCountry="USA" or strCountry="U.S.A." or strCountry="United States" or strCountry="America" Then strCountry="United States of America"
		strSql="SELECT * FROM " & strTablePrefix & "BAN_IPS WHERE IP_COUNTRY LIKE '%" & strCountry & "%'"
		Set rsCheck=my_Conn.Execute(strSql)
		If not rsCheck.EOF Then
			Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
				"	<tr valign=""middle"">" & vbNewLine & _
				"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
				"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Already banned." & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"			</table>" & vbNewLine & _
				"		</td>" & vbNewLine & _
				"	</tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
			rsCheck.Close
			Set rsCheck=Nothing
			WriteFooter
			Response.End
		End If
		Set rsCheck=Nothing
	End If
	If strStart > "" Then
		Err.Clear
		strSqlIP="SELECT IPCOUNTRY FROM " & strTablePrefix & "IPTOCOUNTRY WHERE IPSTART <= '" & strStart & "' AND IPEND >= '" & strStart & "'"
		Set rsCheck=my_Conn.Execute(strSqlIP)
		If rsCheck.EOF Then
			Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
				"	<tr valign=""middle"">" & vbNewLine & _
				"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
				"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>IP address not found in Country IP list." & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"			</table>" & vbNewLine & _
				"		</td>" & vbNewLine & _
				"	</tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
			rsCheck.Close
			Set rsCheck=Nothing
			WriteFooter
			Response.End
		Else
			strSqlIP2="SELECT IP_COUNTRY FROM " & strTablePrefix & "BAN_IPS WHERE IP_COUNTRY='" & rsCheck("IPCountry") & "'"
			Set rsCheck2=my_Conn.Execute(strSqlIP2)
			If not rsCheck2.EOF Then
				Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
					"	<tr valign=""middle"">" & vbNewLine & _
					"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
					"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
					"				<tr valign=""middle"">" & vbNewLine & _
					"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
					"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
					"						</font>" & vbNewLine & _
					"					</td>" & vbNewLine & _
					"				</tr>" & vbNewLine & _
					"				<tr valign=""middle"">" & vbNewLine & _
					"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
					"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Already banned by country:  <b>" & rsCheck("IPCountry") & "</b>" & vbNewLine & _
					"						</font>" & vbNewLine & _
					"					</td>" & vbNewLine & _
					"				</tr>" & vbNewLine & _
					"			</table>" & vbNewLine & _
					"		</td>" & vbNewLine & _
					"	</tr>" & vbNewLine & _
					"</table>" & vbNewLine & _
					"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
				rsCheck2.Close
				Set rsCheck2=Nothing
				rsCheck.Close
				Set rsCheck=Nothing
				WriteFooter
				Response.End
			End If
			Set rsCheck2=Nothing
			rs.Close
		End If
		Set rs=Nothing
	End If	
	strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS WHERE (IP_START < '" & strStart & "' AND IP_END > '" & strStart & "') OR IP_START='" & strStart & "' OR IP_END='" & strStart & "'"
	Set rsCheck=my_Conn.Execute(strSql)
	If not rsCheck.EOF Then
		Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
			"	<tr valign=""middle"">" & vbNewLine & _
			"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Already banned in range:  " & rsCheck("IP_START") & "-" & rsCheck("IP_END") & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"		</td>" & vbNewLine & _
			"	</tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
		rsCheck.Close
		Set rsCheck=Nothing
		WriteFooter
		Response.End
	End If
	Set rsCheck=Nothing
	If len(Request("IP_Country")) <2 Then
		strIPCountry=""
	Else
		strIPCountry=ChkString(Request("IP_Country"),"SQLString")
	End If
	strMyIP=Request.ServerVariables("REMOTE_ADDR")
	intSeg=0
	For i = 1 to len(strMyIP)
		If mid(strMyIP,i,1)="." Then
			intSeg=intSeg+1
			If intSeg=1 Then 
				strPart1=right(strLead&left(strMyIP,i-1),3)
				x=i
			End If
			If intSeg=2 Then
				strPart2=right(strLead&mid(strMyIP,x+1,i-x-1),3)
				y=i
			End If
			If intSeg=3 Then
				strPart3=right(strLead&mid(strMyIP,y+1,i-y-1),3)
				strPart4=right((strLead&mid(strMyIP,i+1)),3)
			End If
		End If
	Next
	strMyIP=strPart1&"."&strPart2&"."&strPart3&"."&strPart4
	If strMyIP>=strStart and strMyIP<=strEnd Then
		Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
			"	<tr valign=""middle"">" & vbNewLine & _
			"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>This range would ban your own connection." & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"		</td>" & vbNewLine & _
			"	</tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
		WriteFooter
		Response.End
	End If	
	strSql = "INSERT INTO " & strTablePrefix & "BAN_IPS (IP_START,IP_END,IP_COUNTRY) VALUES ('" & chkString(strStart,"SqlString") & "', '" & chkString(strEnd,"SqlString") & "', '" & strIPCountry & "')"
	my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
	Response.Write	"<table align=""center"" width=""50%"" bgColor=""" & strPopUpBorderColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Added!" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
	WriteFooter
	Response.End
End If
If Request.QueryString("mode")="edit" Then
	Response.Write "<form action=""admin_ban_ips.asp?Ban_ID=" & Request.QueryString("Ban_ID") & """ method=""post"">" & vbNewLine & _
		"	<input type=""hidden"" name=""EditBan"" value=""doit"">" & vbNewLine & _
		"	<table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" align=""center"" bgColor=""transparent"">" & vbNewLine & _
		"		<tr>" & vbNewLine & _
		"			<td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"				<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
		"					<tr valign=""middle"">" & vbNewLine & _
		"						<td colspan=""3"" align=""center"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strCategoryFontSize & """ color=""" & strCategoryFontColor & """> <b>Edit Ban</b> </font></td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr valign=""middle"">" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP Start</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP End</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""10%"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>Tools</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine
	strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS WHERE Ban_ID=" & Request("Ban_ID")
	Set rsBan=my_Conn.Execute(strSql)
	intban=0
	If not rsBan.EOF Then
		intban=1
		Response.Write	"					<tr valign=""middle"">" & vbNewLine & _
			"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
			"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
			"								<input type=""text"" name=""IP_START"" size=""30"" maxlength=""255"" value=""" & rsBan("IP_START")&""">" & vbNewLine & _
			"							</font>" & vbNewLine & _
			"						</td>" & vbNewLine & _
			"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
			"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
			"								<input type=""text"" name=""IP_END"" size=""30"" maxlength=""255"" value=""" & rsBan("IP_END")&""">" & vbNewLine & _
			"							</font>" & vbNewLine & _
			"						</td>" & vbNewLine & _
			"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""10%"">" & vbNewLine & _
			"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """> " & vbNewLine & _
			"							</font>" & vbNewLine & _
			"						</td>" & vbNewLine & _
			"					</tr>" & vbNewLine
		rsBan.Close
	Else
		Response.Write	"					<tr valign=""middle""><td colspan=""3"" align=""center"" bgcolor=""" & strForumCellColor & """>Not found!</td></tr>"
	End If
	Set rsBan = Nothing
	Response.Write	"				</table>" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine
	If intBan Then
		Response.Write	"		<tr valign=""top"">" & vbNewLine & _
			"			<td align=""center"" width=""100%"" bgcolor=""transparent"">" & vbNewLine & _
			"				<input type=""image"" src="""& strImageURL &"submit.png"" height=""40"" width=""80"" name=""submit"" value=""Submit"">" & vbNewLine & _
			"			</td>" & vbNewLine & _
			"		</tr>" & vbNewLine
	End If
	Response.Write	"	</table>" & vbNewLine & _
		"</form>" & vbNewLine
	WriteFooter
	Response.End
End If
Response.Write "<form action=""admin_ban_ips.asp?mode=add"" method=""post"">" & vbNewLine & _
	"	<table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" align=""center"" bgColor=""transparent"">" & vbNewLine & _
	"		<tr>" & vbNewLine & _
	"			<td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
	"				<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td colspan=""3"" align=""center"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strCategoryFontSize & """ color=""" & strCategoryFontColor & """> <b>Add Ban</b> </font></td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP Start</b>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP End</b>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""10%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """> " & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
	"								<input type=""text"" name=""IP_START"" size=""30"" maxlength=""255"" value=""" & Request.Form("IP_START")&""">" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
	"								<input type=""text"" name=""IP_END"" size=""30"" maxlength=""255"" value=""" & Request.Form("IP_END")&""">" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""10%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """> " & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ colspan=""3"" width=""100%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>Country</b>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strForumCellColor & """ colspan=""3"" width=""100%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
	"								<select name=""IP_Country"">" & vbNewLine & _
	"									<option selected value=""."">--Choose--</option>"
%>
<!--#INCLUDE FILE="countries.asp"-->
<%
Response.Write	"								</select>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"				</table>" & vbNewLine & _
	"			</td>" & vbNewLine & _
	"		</tr>" & vbNewLine & _
	"		<tr valign=""top"">" & vbNewLine & _
	"			<td align=""center"" width=""100%"" bgcolor=""transparent"">" & vbNewLine & _
	"			<input type=""image"" src="""& strImageURL &"add.png"" height=""40"" width=""80"" name=""submit"" value=""Submit"">" & vbNewLine & _
	"			</td>" & vbNewLine & _
	"		</tr>" & vbNewLine & _
	"	</table>" & vbNewLine & _
	"</form><br />" & vbNewLine & _
	"<table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" align=""center"" bgColor=""transparent"">" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
	"			<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine
strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS ORDER BY IP_START ASC"
Set rsBan=my_Conn.Execute(strSql)
If not rsBan.EOF Then
	intI=0
	rsBan.MoveFirst
	Do while not rsBan.EOF
		If len(rsBan("IP_START")) > 1 Then
			IPLookup
		Else
			strIPT=rsBan("IP_COUNTRY")
		End If
		If intI=0 Then CColor=strForumFirstCellColor Else CColor=strAltForumCellColor
		Response.Write	"				<tr valign=""middle"">" &  vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""25%"" align=""center"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & rsBan("IP_START") & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""25%"" align=""center"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & rsBan("IP_END") & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""40%"" align=""center"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & strIPT & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""10%"" align=""center"">" & vbNewLine & _
			"						<a href=""admin_ban_ips.asp?mode=edit&Ban_ID="&rsBan("Ban_ID")&"""" & dWStatus("Edit Ban") & "><acronym style=""border:none; text-decoration:none"" title=""Edit Ban""><img src="""& strImageURL &"icon_pencil.gif"" style=""border:none"" alt=""Edit Ban"" hspace=""0"" style=""text-decoration:none;""></acronym></a>" & vbNewLine & _
			"						<a href=""admin_ban_ips.asp?mode=delete&Ban_ID="&rsBan("Ban_ID")&"""" & dWStatus("Delete Ban") & "><acronym style=""border:none; text-decoration:none"" title=""Delete Ban""><img src="""& strImageURL &"icon_trashcan.gif"" style=""border:none"" alt=""Delete Ban"" hspace=""0"" style=""text-decoration:none;""></acronym></a>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine
		rsBan.MoveNext
		inI=1-intI
	Loop
	rsBan.Close
End If
Set rsBan = Nothing
Response.Write	"				</tr>" & vbNewLine & _
	"			</table>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table>" & vbNewLine
WriteFooter

Function IPLookup
	strSqlIP="SELECT IPCOUNTRY FROM " & strTablePrefix & "IPTOCOUNTRY WHERE IPSTART <= '" & rsBan("IP_START") & "' AND IPEND >= '" & rsBan("IP_START") & "'"
	Set rsLocale= my_Conn.Execute(strSqlIP)
	If NOT (rsLocale.BOF or rsLocale.EOF) Then
		strIPT=rsLocale("IPCOUNTRY")
		rsLocale.Close
	End If
	Set rsLocale = Nothing
End Function
%>
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 October 2013 :  14:38:08  Show Profile
quote:
Originally posted by Carefree

I didn't include all possible methods of identifying the country (e.g., "America", "North America", "United States", "USA", "US", "U.S.A.", etc.). But if you want to ban someone registered as "US", I'll add a routine to convert all of those.

What is the member's IP address? They should ALL be included.


I need "something" that will work ASAP, Carefree! This member is on a rage on the new domain.

I emailed you the IP address, Carefree. I added the member's IP address in the appropriate area when trying to ban him. That's when I received the error message I mentioned.


OOPS! I didn't see your reply above. I'm off use what you posted.




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 19 October 2013 14:49:00
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 October 2013 :  14:48:11  Show Profile
quote:
Originally posted by Carefree

You'll still get the error for an unknown IP address, but it will return after notifying you.

Okay, I did receive the error message but it looked a bit different and then the screen returned back to the "Banning IP" window. That was different than before. Before, it just stayed on the error message window that opened.

So, do you think that means it worked, Carefree?


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 19 October 2013 :  15:13:55  Show Profile  Visit Webbo's Homepage
For a quick fix go into Admin Options and select E-mail Server Configuration abd then set Restrict Registration to 'on'

That way you will be able to manually approve registrations, or in his case not
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 19 October 2013 :  15:54:59  Show Profile
No. You've got something missing in the IP2Country table. You should probably redo the dbs files. Do them in order, the A file will delete the table and recreate it.
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 October 2013 :  16:34:59  Show Profile
quote:
Originally posted by Carefree

No. You've got something missing in the IP2Country table. You should probably redo the dbs files. Do them in order, the A file will delete the table and recreate it.


Okay, I'm off to redo the dbs files.


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 October 2013 :  16:47:07  Show Profile
I redid the database files and tried to do the banning again.

Error: "IP address not found in Country IP list."


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 20 October 2013 :  01:05:21  Show Profile
Carefree, I went through the dbs files and I think I found a problem in D.

(IPSTART,IPEND,IPCOUNTRY)#('24.115.0.0','24.115.255.255','United States')
(IPSTART,IPEND,IPCOUNTRY)#('24.116.0.0','24.117.255.255','United States')
(IPSTART,IPEND,IPCOUNTRY)#('24.118.0.0','24.118.255.255','United States')
(IPSTART,IPEND,IPCOUNTRY)#('24.119.0.0','24.119.255.255','United States')
(IPSTART,IPEND,IPCOUNTRY)#('24.120.0.0','24.120.255.255','United States')
(IPSTART,IPEND,IPCOUNTRY)#('24.121.0.0','24.121.255.255','United States')


I changed the one in red above to

(IPSTART,IPEND,IPCOUNTRY)#('24.116.0.0','24.116.255.255','United States')

and then added this additional line

(IPSTART,IPEND,IPCOUNTRY)#('24.117.0.0','24.117.255.255','United States')

and then I re-ran all of the dbs files.

However; nothing changed. I received the same error message as in post above.





"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 20 October 2013 01:07:28
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07