]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Added LinksToIPWhoIs parameter.
authoreldy <>
Wed, 18 Sep 2002 12:25:39 +0000 (12:25 +0000)
committereldy <>
Wed, 18 Sep 2002 12:25:39 +0000 (12:25 +0000)
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index 2a34c4af6a6d10dc3b78a41d965bf5409c7da188..ff892bbc43dc0aa3c2c1f994e7419cb7f8528575 100644 (file)
@@ -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: ""
 #
index a5fdd845b21aa8c9d1bd3e711345321d431002db..8fa966df948a66a62072f524975fb5463b78c6ed 100644 (file)
@@ -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 "<td>";
-       if ($keyforwhois) { print "<a href=\"$LinksToWhoIs$keyforwhois\" target=awstatswhois>?</a>"; }
+       if ($keyforwhois && $linkforwhois) { print "<a href=\"$linkforwhois$keyforwhois\" target=awstatswhois>?</a>"; }
        else { print "&nbsp;" }
        print "</td>";
 }