From d437a89d014a603a837f0423382ff9d207a9d7ab Mon Sep 17 00:00:00 2001 From: eldy <> Date: Wed, 18 Sep 2002 12:25:39 +0000 Subject: [PATCH] Added LinksToIPWhoIs parameter. --- wwwroot/cgi-bin/awstats.model.conf | 20 ++++++++++++++------ wwwroot/cgi-bin/awstats.pl | 27 +++++++++++++++++---------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 2a34c4af..ff892bbc 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -614,9 +614,10 @@ ShowLinksOnUrl=1 MaxLengthOfURL=72 -# AWStats can include a link to WhoIs database on all hostnames. For this, you -# must set ShowLinksToWhoIs to 1. Warning, a such feature depends on next -# parameter (LinksForWhoIs) and on WhoIs server exhaustivity and availability. +# AWStats can include a link to WhoIs database on hostnames/ip. For this, you +# must set ShowLinksToWhoIs to 1. Warning, a such feature depends on two next +# parameters (LinksToWhoIs and LinksToIPWhoIs) and on WhoIs server +# exhaustivity and availability. # For this reason, this feature can't be a reliable feature. # Possible values: 1 or 0 # Default: 0 @@ -624,16 +625,23 @@ MaxLengthOfURL=72 ShowLinksToWhoIs=0 -# Set here the link used to point to Internet WhoIs database. +# Set here the link used to point to Internet WhoIs database for hostnames. # This parameter is not used if ShowLinksToWhoIs is 0. # Default: "http://www.whois.net/search.cgi2?str=" -# Example: "http://www.netsol.com/cgi-bin/whois/whois?SearchType=all&STRING=" # Example: "http://www.ripe.net/perl/whois?form_type=simple&searchtext=" -# Example: "http://www.arin.net/cgi-bin/whois.pl?queryinput=" +# Example: "http://ws.arin.net/cgi-bin/whois.pl?queryinput=" # LinksToWhoIs="http://www.whois.net/search.cgi2?str=" +# Set here the link used to point to Internet WhoIs database for ip addresses. +# This parameter is not used if ShowLinksToWhoIs is 0. +# Default: "http://ws.arin.net/cgi-bin/whois.pl?queryinput=" +# Example: "http://ws.arin.net/cgi-bin/whois.pl?queryinput=" +# +LinksToIPWhoIs="http://ws.arin.net/cgi-bin/whois.pl?queryinput=" + + # You can put here HTML code that will be added at the top of AWStats reports. # Default: "" # diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index a5fdd845..8fa966df 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -155,13 +155,13 @@ $LevelForSearchEnginesDetection, $LevelForKeywordsDetection)= (2,1,1,1,1,1); use vars qw/ $DirLock $DirCgi $DirData $DirIcons $DirLang $AWScript $ArchiveFileName -$AllowAccessFromWebToFollowingIPAddresses $HTMLHeadSection $HTMLEndSection $LinksToWhoIs +$AllowAccessFromWebToFollowingIPAddresses $HTMLHeadSection $HTMLEndSection $LinksToWhoIs $LinksToIPWhoIs $LogFile $LogFormat $LogSeparator $Logo $LogoLink $StyleSheet $WrapperScript $SiteDomain /; ($DirLock, $DirCgi, $DirData, $DirIcons, $DirLang, $AWScript, $ArchiveFileName, -$AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection, $HTMLEndSection, $LinksToWhoIs, +$AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection, $HTMLEndSection, $LinksToWhoIs, $LinksToIPWhoIs, $LogFile, $LogFormat, $LogSeparator, $Logo, $LogoLink, $StyleSheet, $WrapperScript, $SiteDomain)= -("","","","","","","","","","","","","","","","","","",""); +("","","","","","","","","","","","","","","","","","","",""); use vars qw/ $color_Background $color_TableBG $color_TableBGRowTitle $color_TableBGTitle $color_TableBorder $color_TableRowTitle $color_TableTitle @@ -924,6 +924,7 @@ sub Read_Config { if ($param =~ /^MaxLengthOfURL/) { $MaxLengthOfURL=$value; next; } if ($param =~ /^ShowLinksToWhoIs/) { $ShowLinksToWhoIs=$value; next; } if ($param =~ /^LinksToWhoIs/) { $LinksToWhoIs=$value; next; } + if ($param =~ /^LinksToIPWhoIs/) { $LinksToIPWhoIs=$value; next; } if ($param =~ /^HTMLHeadSection/) { $HTMLHeadSection=$value; next; } if ($param =~ /^HTMLEndSection/) { $HTMLEndSection=$value; next; } if ($param =~ /^BarWidth/) { $BarWidth=$value; next; } @@ -3219,20 +3220,26 @@ sub Format_Date { #-------------------------------------------------------------------- # Function: Write a HTML cell with a WhoIs link to parameter -# Parameters: Key to used as WhoIs target -# Input: $LinksToWhoIs +# Parameters: Key to used as WhoIs target +# Input: $LinksToWhoIs $LinksToIPWhoIs # Output: None -# Return: String YYYYMMDDHHMMSS +# Return: None #-------------------------------------------------------------------- sub ShowWhoIsCell { my $keyurl=shift; my $keyforwhois; - if ($keyurl =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { - # $keyforwhois=$key; + my $linkforwhois; + if ($keyurl =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { # IP address + $keyforwhois=$keyurl; + $linkforwhois="$LinksToIPWhoIs"; + } + else { # Hostname + $keyurl =~ /(\w+\.\w+)$/; + $keyforwhois=$1; + $linkforwhois="$LinksToWhoIs"; } - else { $keyurl =~ /(\w+\.\w+)$/; $keyforwhois=$1; } print ""; - if ($keyforwhois) { print "?"; } + if ($keyforwhois && $linkforwhois) { print "?"; } else { print " " } print ""; } -- 2.47.3