• Resolved mathijsvdbeek

    (@mathijsvdbeek)


    I have some user who login with IPV6 and because of that have dynamic IPV4 adresses. Is it possible update (idea) to log IPV6 or IPV4 depending on IP-address so I can still use the plugin?

    Kind regards,

    Mathijs

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ralxz

    (@ralxz)

    Hey Mathijs,

    Thanks for the message. That’s a great idea, I’ll see if I can put in some logic to use their IPV6 address if available.

    I’ll see if I can get to it this week.

    Cheers,
    Ryan

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Awesome ??

    Plugin Author ralxz

    (@ralxz)

    Hey Mathijs,

    I just looked into this, and it looks like if they are using IPV6 it should be logging correctly.

    This is the code in the plugin:

        function get_user_ip() {
            $client = @$_SERVER['HTTP_CLIENT_IP'];
            $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
            $remote = $_SERVER['REMOTE_ADDR'];
    
            if(filter_var($client, FILTER_VALIDATE_IP)) {
                $ip = $client;
            } elseif(filter_var($forward, FILTER_VALIDATE_IP)) {
                $ip = $forward;
            } else {
                $ip = $remote;
            }
    
            return $ip;
        }
    

    If the server is accepting connections on an IPv6 socket, then it should report back correctly. If you are only getting IPv4 addresses for your users, maybe it’s something to due with your hosting configuration?

    Let me know if I can be more help.

    -Ryan

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    Oke. Thanks ?? When I change hosting in januari I will ask to set it up right ??

    Thread Starter mathijsvdbeek

    (@mathijsvdbeek)

    It works on my new server ??

    Plugin Author ralxz

    (@ralxz)

    Great, glad to hear ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘log IPV6’ is closed to new replies.