add function geoip()

This commit is contained in:
Uwe Steinmann 2026-02-09 16:20:24 +01:00
parent 7d57de992a
commit 34e612bd29

View File

@ -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');