mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-02-23 23:17:05 +08:00
Fix Ip Log for cloudflare tunnel
This commit is contained in:
parent
954a49978c
commit
7b0bc12e98
1 changed files with 16 additions and 1 deletions
15
init.php
15
init.php
|
@ -195,7 +195,22 @@ function _log($description, $type = '', $userid = '0')
|
||||||
$d->type = $type;
|
$d->type = $type;
|
||||||
$d->description = $description;
|
$d->description = $description;
|
||||||
$d->userid = $userid;
|
$d->userid = $userid;
|
||||||
|
if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) //to check ip is pass from cloudflare tunnel
|
||||||
|
{
|
||||||
|
$d->ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
|
||||||
|
}
|
||||||
|
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
|
||||||
|
{
|
||||||
|
$d->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
|
}
|
||||||
|
elseif (!empty($_SERVER['HTTP_CLIENT_IP'])) //to check ip from share internet
|
||||||
|
{
|
||||||
|
$d->ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$d->ip = $_SERVER["REMOTE_ADDR"];
|
$d->ip = $_SERVER["REMOTE_ADDR"];
|
||||||
|
}
|
||||||
$d->save();
|
$d->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue