Skip to content

Commit

Permalink
MDL-23720 importing latest PEAR GeoIP module
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 9, 2010
1 parent 4806e6d commit bbb13f0
Show file tree
Hide file tree
Showing 11 changed files with 1,426 additions and 5,379 deletions.
8 changes: 4 additions & 4 deletions iplookup/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

require('../config.php');
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/geoip/geoipcity.inc');
require_once('Net/GeoIP.php');

require_login();

Expand Down Expand Up @@ -64,9 +64,9 @@
}

if (!empty($CFG->geoipfile) and file_exists($CFG->geoipfile)) {
$gi = geoip_open($CFG->geoipfile, GEOIP_STANDARD);
$location = geoip_record_by_addr($gi, $ip);
geoip_close($gi);
$geoip = Net_GeoIP::getInstance($CFG->geoipfile, Net_GeoIP::STANDARD);
$location = $geoip->lookupLocation($ip);
$geoip->close();

if (empty($location)) {
print_error('iplookupfailed', 'error', '', $ip);
Expand Down
66 changes: 0 additions & 66 deletions lib/geoip/ChangeLog.htm

This file was deleted.

43 changes: 0 additions & 43 deletions lib/geoip/README.htm

This file was deleted.

Loading

0 comments on commit bbb13f0

Please sign in to comment.