mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-06-08 08:52:23 +02:00
More accurate ip recognition (#807)
This commit is contained in:
parent
b24887d4fd
commit
a64e3c76d3
|
@ -246,7 +246,9 @@ if (isset($_GET['logout'])) {
|
||||||
// Validate connection IP
|
// Validate connection IP
|
||||||
if ($ip_ruleset != 'OFF') {
|
if ($ip_ruleset != 'OFF') {
|
||||||
function getClientIP() {
|
function getClientIP() {
|
||||||
if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
|
if (array_key_exists('HTTP_CF_CONNECTING_IP', $_SERVER)) {
|
||||||
|
return $_SERVER["HTTP_CF_CONNECTING_IP"];
|
||||||
|
}else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
|
||||||
return $_SERVER["HTTP_X_FORWARDED_FOR"];
|
return $_SERVER["HTTP_X_FORWARDED_FOR"];
|
||||||
}else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
|
}else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
|
||||||
return $_SERVER['REMOTE_ADDR'];
|
return $_SERVER['REMOTE_ADDR'];
|
||||||
|
|
Loading…
Reference in a new issue