mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-31 23:20:43 +02:00
Merge pull request #154 from gerandonk/Development
Fix Ip Log for cloudflare tunnel
This commit is contained in:
commit
faca5d0359
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->description = $description;
|
||||
$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->save();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue