Fix per loggare anche IP locali

This commit is contained in:
Luca 2018-03-28 01:02:10 +02:00
parent cbd1e01d29
commit 854f6709a9
1 changed files with 3 additions and 1 deletions

View File

@ -407,7 +407,9 @@ function create_thumbnails($tmp, $filename, $dir)
function get_client_ip()
{
$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'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];