• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Getting IP address Behind Cloudflare

Status
Not open for further replies.

Hammer

Chevereto Member
Hello ,
I am using CloudFlare for caching and Protecting my website
but all time i use file manager i can not find real ip address of uploader
i think you used
Code:
$_SERVER['REMOTE_ADDR']
to log Uploader ip
but this only log the cloudflare ip ...
i must use
Code:
$_SERVER["HTTP_CF_CONNECTING_IP"]
For Get the Ip Address, but i dont know how i can use it on chevereto? what file must edited?
 
Solved:

only edit the " /includes/classes/class.db.php"

find:
Code:
$file_array['uploader_ip'] : $_SERVER['REMOTE_ADDR'];
Replace With:
Code:
$file_array['uploader_ip'] : $_SERVER["HTTP_CF_CONNECTING_IP"];
 
My two cents:

In includes/config.php at the very bottom.. change this:
PHP:
/*** CloudFlare IP workaround ***/
// Uncomment this line if you are using CloudFlare
//$_SERVER['REMOTE_ADDR'] = (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];

To this:
PHP:
/*** CloudFlare IP workaround ***/
// Uncomment this line if you are using CloudFlare
$_SERVER['REMOTE_ADDR'] = (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];
 
Status
Not open for further replies.
Back
Top