1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Fix per loggare anche IP locali

This commit is contained in:
Luca
2018-03-28 01:02:10 +02:00
parent cbd1e01d29
commit 854f6709a9

View File

@@ -407,7 +407,9 @@ function create_thumbnails($tmp, $filename, $dir)
function get_client_ip() function get_client_ip()
{ {
$ipaddress = ''; $ipaddress = '';
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { if (getHostByName(getHostName())){
$ipaddress = getHostByName(getHostName());
}else if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ipaddress = $_SERVER['HTTP_CLIENT_IP']; $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];