Users sharing IP addresses

Admin CP -> Users -> Search for Users -> Search by IP Address

That doesn't automatically show IP addresses with more than one user.

If you know the IP address to check, then that works. Having an automated query or detective control for users with the same IP would be fairly beneficial. I know we rely on a vB mod for detecting users with duplicate accounts and multiple accounts from one IP source.
 
A custom script is required for more complete reporting, but this query may be sufficient:

Code:
SELECT INET_NTOA(i.ip) AS ipAddress, COUNT(*) AS numUsers, u.username AS oneUsername
FROM xf_user AS u
LEFT JOIN xf_ip AS i ON (i.user_id = u.user_id AND i.action = 'register')
GROUP BY ipAddress;

You get data like this:

Screen shot 2012-10-01 at 12.21.56 AM.webp

edit... actually this may be more useful:

Code:
SELECT INET_NTOA(i.ip) AS ipAddress, COUNT(*) AS numUsers, u.username AS oneUsername
FROM xf_user AS u
LEFT JOIN xf_ip AS i ON (i.user_id = u.user_id AND i.action = 'register')
GROUP BY i.ip
ORDER BY numUsers
DESC;

That will list the highest number of matching IPs first.
 
You can try:
Code:
SELECT INET_NTOA(CONV(HEX(i.ip), 16, 10)) AS ipAddress, COUNT(*) AS numUsers, u.username AS oneUsername
FROM xf_user AS u
LEFT JOIN xf_ip AS i ON (i.user_id = u.user_id AND i.action = 'register')
GROUP BY i.ip
ORDER BY numUsers DESC;
 
You can try:
Code:
SELECT INET_NTOA(CONV(HEX(i.ip), 16, 10)) AS ipAddress, COUNT(*) AS numUsers, u.username AS oneUsername
FROM xf_user AS u
LEFT JOIN xf_ip AS i ON (i.user_id = u.user_id AND i.action = 'register')
GROUP BY i.ip
ORDER BY numUsers DESC;
That is closer. It now shows full IP addresses but only returns about 55% of my users, none of which are my 4 accounts which should all have the same IP.
 
Back
Top Bottom