|
@@ 582-584 (lines=3) @@
|
| 579 |
|
* @return array |
| 580 |
|
*/ |
| 581 |
|
public function locateUser() { |
| 582 |
|
if (CONFIG['GEOIP']['version'] != 1) { |
| 583 |
|
return ['status' => 'error', 'error' => 'Function for GEOIPv1 called, but config says this is not the version to use!']; |
| 584 |
|
} |
| 585 |
|
//$host = $_SERVER['REMOTE_ADDR']; |
| 586 |
|
$host = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); |
| 587 |
|
$record = geoip_record_by_name($host); |
|
@@ 607-609 (lines=3) @@
|
| 604 |
|
* @return array |
| 605 |
|
*/ |
| 606 |
|
public function locateUser2() { |
| 607 |
|
if (CONFIG['GEOIP']['version'] != 2) { |
| 608 |
|
return ['status' => 'error', 'error' => 'Function for GEOIPv2 called, but config says this is not the version to use!']; |
| 609 |
|
} |
| 610 |
|
require_once CONFIG['GEOIP']['geoip2-path-to-autoloader']; |
| 611 |
|
$reader = new Reader(CONFIG['GEOIP']['geoip2-path-to-db']); |
| 612 |
|
$host = $_SERVER['REMOTE_ADDR']; |