Don't want IPs in Query Log output

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-03-05 16:35:42 +01:00
parent 9e5eba4036
commit 1ec38e3a79
2 changed files with 13 additions and 8 deletions

View File

@@ -139,17 +139,19 @@ function disconnectFTL($quiet=true)
}
}
$clients = [];
function resolveHostname($clientip)
$clients = array();
function resolveHostname($clientip, $printIP)
{
if(array_key_exists($clientip, $clients))
{
// Entry already exists
$clientname = $clients[$clientip];
return $clientname."|".$clientip;
if($printIP)
return $clientname."|".$clientip;
return $clientname;
}
if(filter_var($clientip, FILTER_VALIDATE_IP))
else if(filter_var($clientip, FILTER_VALIDATE_IP))
{
// Get host name of client and convert to lower case
$clientname = strtolower(gethostbyaddr($clientip));
@@ -161,6 +163,9 @@ function resolveHostname($clientip)
}
// Buffer result
$clients[$clientname] = $clientip;
return $clientname."|".$clientip;
if($printIP)
return $clientname."|".$clientip;
return $clientname;
}
?>