|
@@ 410-412 (lines=3) @@
|
| 407 |
|
} |
| 408 |
|
|
| 409 |
|
private function locateUser1() { |
| 410 |
|
if (CONFIG['GEOIP']['version'] != 1) { |
| 411 |
|
return ['status' => 'error', 'error' => 'Function for GEOIPv1 called, but config says this is not the version to use!']; |
| 412 |
|
} |
| 413 |
|
//$host = $_SERVER['REMOTE_ADDR']; |
| 414 |
|
$host = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); |
| 415 |
|
$record = geoip_record_by_name($host); |
|
@@ 435-437 (lines=3) @@
|
| 432 |
|
* @return array |
| 433 |
|
*/ |
| 434 |
|
private function locateUser2() { |
| 435 |
|
if (CONFIG['GEOIP']['version'] != 2) { |
| 436 |
|
return ['status' => 'error', 'error' => 'Function for GEOIPv2 called, but config says this is not the version to use!']; |
| 437 |
|
} |
| 438 |
|
require_once CONFIG['GEOIP']['geoip2-path-to-autoloader']; |
| 439 |
|
$reader = new Reader(CONFIG['GEOIP']['geoip2-path-to-db']); |
| 440 |
|
$host = $_SERVER['REMOTE_ADDR']; |