+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Finding my header.php file

  1. #1

    Finding my header.php file

    Hello

    My Flynax marketplace was working fine.
    After putting some Ezoic ads (using their DNS), my members cannot log in anymore...

    Ezoic team told me to make this change : "put in your header.php, init.php, or config.php file, you should already see $_SERVER['REMOTE_ADDR'] which you can replace with $_SERVER['HTTP_X_FORWARDED_FOR']"

    I have looked in my FTP and cannot locate these header.php, init.php, or config.php files.
    Do you know where I can find them ???


    I found only a header.tpl file... without this $_SERVER['REMOTE_ADDR' inside.

    Thanks a lot to all
    Olivier

  2. #2
    I believe that the header.tpl you found in the template folder is not the header.tpl Ezois team refer to.
    For the fastest support, you should contact the support team from your host provider. The init.php is server config file.

  3. #3
    Thanks Wei, where is this init.php file ?

    I don't find it in the template file...

  4. #4
    Viktor, I need your help as it is your template.

    Where can I find this "$_SERVER['REMOTE_ADDR']" in your code ?

  5. #5
    Hello Guys,

    The file you are looking for is called Util.php and it's located here : /includes/utils/Util.php

    Once you open the file you will find these lines of code :

    'REMOTE_ADDR',
    'HTTP_X_FORWARDED_FOR',
    'HTTP_X_FORWARDED',
    'HTTP_X_CLUSTER_CLIENT_IP',
    'HTTP_FORWARDED_FOR',
    'HTTP_FORWARDED',
    );

    The code is also present on some others files, these are all files containing the code you are looking for :

    \includes\utils\Util.php
    Line 104: 'REMOTE_ADDR',

    \libs\ckfinder\core\connector\php\vendor\monolog\m onolog\src\Monolog\Processor\WebProcessor.php
    Line 35: 'ip' => 'REMOTE_ADDR',

    \libs\ckfinder\core\connector\php\vendor\symfony\h ttp-foundation\Request.php
    Line 318: 'REMOTE_ADDR' => '127.0.0.1',
    Line 802: $ip = $this->server->get('REMOTE_ADDR');
    Line 1925: return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies);

    \libs\ckfinder\core\connector\php\vendor\symfony\h ttp-kernel\Fragment\InlineFragmentRenderer.php
    Line 131: $server['REMOTE_ADDR'] = '127.0.0.1';

    \libs\ckfinder\core\connector\php\vendor\symfony\h ttp-kernel\HttpCache\HttpCache.php
    Line 471: $request->headers->set('X-Forwarded-For', $forwardedFor.', '.$request->server->get('REMOTE_ADDR'));
    Line 473: $request->headers->set('X-Forwarded-For', $request->server->get('REMOTE_ADDR'));
    Line 478: $request->server->set('REMOTE_ADDR', '127.0.0.1');


    Enjoy

    regards,
    AMIR

  6. #6
    Thank you Amir, any idea which file I should change to get a X-Forwarded-For (XFF) Header ?

    This is Ezoic guide if it helps : https://support.ezoic.com/kb/article...header#anchor2

    As Ezoic would make me earn 3x more than Adsense, it is a useful change for me (and for all of you if you are monetizing your Flynax marketplace with adsense)

  7. #7
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    If you need to replace REMOTE_ADDR with HTTP_X_FORWARDED_FOR

    you should go to includes > controllers > common.inc.php

    and put this code:
    PHP Code:
    Only registered members can view the code

  8. #8
    [B]Thanks Rudi, one last question : where in the common.inc.php file should I add this code ?
    Can I add this code anywhere adding a new line ?
    I don't want to ruin everything.
    Thank you
    Last edited by Olivier Pequin; October 26, 2020 at 03:34 PM.

  9. #9
    @Rudi, please let me know where in the common.inc.php file I have to add this code.
    Can I add this code anywhere adding a new line ?

    Thank you

  10. #10
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    You can add it at the top before

    PHP Code:
    Only registered members can view the code
    Last edited by Rudi; October 26, 2020 at 04:52 PM.

+ Reply to Thread