mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-02-20 09:38:33 +00:00
add function geoip()
This commit is contained in:
parent
7d57de992a
commit
34e612bd29
|
|
@ -90,6 +90,14 @@ class Utilities { /* {{{ */
|
|||
return base64_encode($bytes);
|
||||
} /* }}} */
|
||||
|
||||
static function geoip($addr) { /* {{{ */
|
||||
if($geoip = @file_get_contents('https://json.geoiplookup.io/'.$addr)) {
|
||||
$data = json_decode($geoip, true);
|
||||
if($data && $data['success'])
|
||||
return $data;
|
||||
}
|
||||
return false;
|
||||
} /* }}} */
|
||||
} /* }}} */
|
||||
|
||||
class_alias('Seeddms\Seeddms\Utilities', 'SeedDMS_Utils');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user