CStrategies
Member
I am attempting to call the
I want a list of IP addresses the user has used so I can match them with banned or discouraged accounts. But whether I feed this method a user_id or a user entity object, it always returns an empty array - even though I can visit the user in the ACP and see that there are IPs recorded in the user's IP logs.
For what it's worth, I also tried the
getIpsByUser
method located in XF/Repository/Ip
. If it makes any difference, I'm calling it from a method in an item in XF/ApprovalQueue
. I have tried calling it with both a user_id as well as a user entity object.
Code:
$content = $unapprovedItem->Content;
$userId = $content->user_id;
$user = \XF::em()->find('XF:User', $userId);
$ipRepo = $app->repository('XF:Ip');
$ips = $ipRepo->getIpsByUser($user);
I want a list of IP addresses the user has used so I can match them with banned or discouraged accounts. But whether I feed this method a user_id or a user entity object, it always returns an empty array - even though I can visit the user in the ACP and see that there are IPs recorded in the user's IP logs.
For what it's worth, I also tried the
getIp
method from the user entity, and that also always returned empty.