~ubuntu-branches/ubuntu/karmic/awstats/karmic-security

« back to all changes in this revision

Viewing changes to wwwroot/cgi-bin/plugins/geoip_region_maxmind.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard, Charles Fry, Jonas Smedegaard
  • Date: 2005-09-19 22:41:16 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050919224116-6bo795sxx5nsosby
Tags: 6.4-2
[ Charles Fry ]
* New co-maintainer.
* Suggest libgeo-ipfree-perl. Closes: #316126 (thanks to Gunnar Wolf
  <gwolf@gwolf.org>).
* Fixed README.Debian path to configure.pl. Closes: #313093 (thanks to
  Michael De Nil <michael@flex-it.be>).

[ Jonas Smedegaard ]
* Acknowledge NMU. Closes: bug#322591.
* Bump up watch version, and adjust the default command (we have moved
  to SubVerSion).
* Add proto to URL in long description.
* User newer chown syntax in postinst (thanks to lintian).

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#-----------------------------------------------------------------------------
8
8
# Perl Required Modules: Geo::IP (Geo::IP::PurePerl is not yet supported)
9
9
#-----------------------------------------------------------------------------
10
 
# $Revision: 1.5 $ - $Author: eldy $ - $Date: 2004/12/10 22:28:39 $
 
10
# $Revision: 1.6 $ - $Author: eldy $ - $Date: 2005/02/19 13:40:46 $
11
11
 
12
12
 
13
13
# <-----
316
316
                my ($res1,$res2,$countryregion)=();
317
317
                ($res1,$res2)=$geoip_region_maxmind->region_by_name($param) if $geoip_region_maxmind;
318
318
                if ($Debug) { debug("  Plugin geoip_region_maxmind: GetRegionByIp for $param: [${res1}_${res2}]",5); }
319
 
            if ($res1 =~ /\w\w/) { print $DomainsHashIDLib{lc($res1)}||uc($res1); }
320
 
            else { print "<span style=\"color: #$color_other\">$Message[0]</span>"; }
321
 
            if ($res1 =~ /\w\w/ && $res2 =~ /\w\w/) {
322
 
                print "&nbsp;(";
323
 
                print $region{lc($res1)}{uc($res2)};
324
 
                print ")";
 
319
            if (! $PluginsLoaded{'init'}{'geoip'}) {
 
320
                # Show country
 
321
                if ($res1 =~ /\w\w/) { print $DomainsHashIDLib{lc($res1)}||uc($res1); }
 
322
                else { print "<span style=\"color: #$color_other\">$Message[0]</span>"; }
 
323
                # Show region
 
324
                if ($res1 =~ /\w\w/ && $res2 =~ /\w\w/) {
 
325
                    print "&nbsp;(";
 
326
                    print $region{lc($res1)}{uc($res2)};
 
327
                    print ")";
 
328
                }
 
329
            }
 
330
            else {
 
331
                if ($res1 =~ /\w\w/ && $res2 =~ /\w\w/) {
 
332
                    print $region{lc($res1)}{uc($res2)};
 
333
                }
 
334
                else { print "<span style=\"color: #$color_other\">$Message[0]</span>"; }
325
335
            }
326
336
                }
327
337
                if ($key && $ip==6) {
331
341
                my ($res1,$res2,$countryregion)=();
332
342
                ($res1,$res2)=$geoip_region_maxmind->region_by_name($param) if $geoip_region_maxmind;
333
343
                if ($Debug) { debug("  Plugin geoip_region_maxmind: GetRegionByName for $param: [${res1}_${res2}]",5); }
334
 
            if ($res1 =~ /\w\w/) { print $DomainsHashIDLib{lc($res1)}||uc($res1); }
335
 
            else { print "<span style=\"color: #$color_other\">$Message[0]</span>"; }
336
 
            if ($res1 =~ /\w\w/ && $res2 =~ /\w\w/) {
337
 
                print "&nbsp;(";
338
 
                print $region{lc($res1)}{uc($res2)};
339
 
                print ")";
 
344
            if (! $PluginsLoaded{'init'}{'geoip'}) {
 
345
                # Show country
 
346
                if ($res1 =~ /\w\w/) { print $DomainsHashIDLib{lc($res1)}||uc($res1); }
 
347
                else { print "<span style=\"color: #$color_other\">$Message[0]</span>"; }
 
348
                # Show region
 
349
                if ($res1 =~ /\w\w/ && $res2 =~ /\w\w/) {
 
350
                    print "&nbsp;(";
 
351
                    print $region{lc($res1)}{uc($res2)};
 
352
                    print ")";
 
353
                }
 
354
            }
 
355
            else {
 
356
                if ($res1 =~ /\w\w/ && $res2 =~ /\w\w/) {
 
357
                    print $region{lc($res1)}{uc($res2)};
 
358
                }
 
359
                else { print "<span style=\"color: #$color_other\">$Message[0]</span>"; }
340
360
            }
341
361
                }
342
362
                print "</td>";