• 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

#1
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?
 

Jake Bunce

XenForo moderator
Staff member
#4
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'
 

bottiger

Active member
#5
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'
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.
 

Jake Bunce

XenForo moderator
Staff member
#6
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.
 

Jake Bunce

XenForo moderator
Staff member
#10
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');