1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Testing CloudFlare on my XF site

Discussion in 'XenForo Questions and Support' started by motowebmaster, Jan 9, 2011.

  1. motowebmaster

    motowebmaster Active Member

    Is there an option within the admincp that enables the ability to see the actual IP through CloudFlare's server network, or a file that I can edit?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Which IP address are you trying to see? The IP of the server? Of a user?
     
  3. motowebmaster

    motowebmaster Active Member

    The actual IP Address of the user.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    There is no place in the Admin CP to view user IPs. But here is a query you can run on your database to view all IPs used by a particular user:

    Code:
    SELECT user.username, INET_NTOA(ip.ip)
    FROM xf_ip AS ip
    LEFT JOIN xf_user AS user ON (user.user_id = ip.user_id)
    WHERE user.username = 'admin'
    GROUP BY ip.ip
    
    Change this line appropriately to match whatever username you want:

    WHERE user.username = 'admin'
     
  5. bottiger

    bottiger Active Member

    Thanks but I already used the user_id and tried selecting it from xf_ip. There were no entries. I don't know why. Maybe the registration entry gets deleted when the user falls outside the spam cleaner range?

    I think Xenforo should save the last used IP per user.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It should log the IP during registration. I don't know why it's not there. But all IPs are stored in that table. There is nowhere else to look except in your server's access logs, but you can't match those records by forum username.
     
  7. bottiger

    bottiger Active Member

    Maybe it doesn't log the IP if the user signs in through Steam?
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Steam auth would be an addon. The addon may be neglecting the IP log.
     
  9. bottiger

    bottiger Active Member

    Do you know what line I need to add to make it record IPs during login?
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    An example from XenForo_ControllerPublic_Register:

    Code:
    		// log the ip of the user registering
    		XenForo_Model_Ip::log($user['user_id'], 'user', $user['user_id'], 'register');
    
     
    bottiger likes this.

Share This Page