mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-04 00:31:50 +02:00
Added user audit details in panel
This commit is contained in:
parent
2c48d48777
commit
6d1f934d36
8 changed files with 197 additions and 25 deletions
|
@ -396,4 +396,33 @@ function createUuidFromId($id) {
|
|||
// Handle exception
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Function to get the client IP address
|
||||
function get_client_ip() {
|
||||
$ipaddress = '';
|
||||
if (getenv('HTTP_CLIENT_IP'))
|
||||
$ipaddress = getenv('HTTP_CLIENT_IP');
|
||||
else if(getenv('HTTP_X_FORWARDED_FOR'))
|
||||
$ipaddress = getenv('HTTP_X_FORWARDED_FOR');
|
||||
else if(getenv('HTTP_X_FORWARDED'))
|
||||
$ipaddress = getenv('HTTP_X_FORWARDED');
|
||||
else if(getenv('HTTP_FORWARDED_FOR'))
|
||||
$ipaddress = getenv('HTTP_FORWARDED_FOR');
|
||||
else if(getenv('HTTP_FORWARDED'))
|
||||
$ipaddress = getenv('HTTP_FORWARDED');
|
||||
else if(getenv('REMOTE_ADDR'))
|
||||
$ipaddress = getenv('REMOTE_ADDR');
|
||||
else
|
||||
$ipaddress = 'UNKNOWN';
|
||||
return $ipaddress;
|
||||
}
|
||||
|
||||
function get_client_location() {
|
||||
$PublicIP = get_client_ip();
|
||||
$json = file_get_contents("http://ipinfo.io/$PublicIP/geo");
|
||||
$json = json_decode($json, true);
|
||||
$country = $json['country'];
|
||||
|
||||
return $country;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue