First change for future geoip module.

This commit is contained in:
Laurent Destailleur 2009-10-13 22:10:06 +00:00
parent d85cdc81eb
commit bd8cbd2f44
2 changed files with 6 additions and 5 deletions

View File

@ -52,13 +52,15 @@ class DolGeoIP
if (empty($type) || empty($datfile)) if (empty($type) || empty($datfile))
{ {
dol_syslog("DolGeoIP::DolGeoIP parameter datafile not defined", LOG_ERR); //dol_syslog("DolGeoIP::DolGeoIP parameter datafile not defined", LOG_ERR);
dol_print_error('DolGeoIP constructor was called with no datafile parameter'); $this->errorlabel='DolGeoIP constructor was called with no datafile parameter';
//dol_print_error('','DolGeoIP constructor was called with no datafile parameter');
print $this->errorlabel;
return 0; return 0;
} }
if (! file_exists($datfile)) if (! file_exists($datfile))
{ {
dol_syslog("DolGeoIP::DolGeoIP datafile ".$datfile." can not be read", LOG_ERR); //dol_syslog("DolGeoIP::DolGeoIP datafile ".$datfile." can not be read", LOG_ERR);
$this->error='ErrorGeoIPClassNotInitialized'; $this->error='ErrorGeoIPClassNotInitialized';
$this->errorlabel="Datafile ".$datfile." not found"; $this->errorlabel="Datafile ".$datfile." not found";
print $this->errorlabel; print $this->errorlabel;

View File

@ -868,9 +868,8 @@ function dol_print_ip($ip)
if (! empty($conf->geoipmaxmind->enabled)) if (! empty($conf->geoipmaxmind->enabled))
{ {
$datafile=$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; $datafile=$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE;
//$ip='24.24.24.24'; //$ip='24.24.24.24';
$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat';
include_once(DOL_DOCUMENT_ROOT.'/lib/dolgeoip.class.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/dolgeoip.class.php');
$geoip=new DolGeoIP('country',$datafile); $geoip=new DolGeoIP('country',$datafile);