• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

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