Ozzy47
Well-known member
I'm extending
Now In my file I do this.
Which works as intended if I am trying to view a members shared IP's that I have in my option. Now the issue I am having trouble with is if another user is sharing IP's with the previously mentioned user, their name shows up in the list. What I want is to remove any users that I have in my setting from any others shared IP list, if they are sharing an IP with one in the option. I just can't quite figure out what I need to do.
XF/Pub/Controller/Member.php
specifically the actionSharedIps
which looks like this.
PHP:
public function actionSharedIps(ParameterBag $params)
{
$user = $this->assertViewableUser($params->user_id);
if (!\XF::visitor()->canViewIps())
{
return $this->noPermission();
}
$shared = $user->getSharedIpUsers($this->options()->sharedIpsCheckLimit);
$viewParams = [
'user' => $user,
'shared' => $shared
];
return $this->view('XF:Member\SharedIps', 'member_shared_ips_list', $viewParams);
}
Now In my file I do this.
PHP:
public function actionUserIps(ParameterBag $params)
{
$parent = parent::actionUserIps($params);
$options = \XF::options();
$user = $parent->getParam('user');
$usernames = $options->ozzmodzHideIp_users;
if (in_array($user['user_id'], $usernames))
{
return $this->noPermission();
}
return $parent;
}
Which works as intended if I am trying to view a members shared IP's that I have in my option. Now the issue I am having trouble with is if another user is sharing IP's with the previously mentioned user, their name shows up in the list. What I want is to remove any users that I have in my setting from any others shared IP list, if they are sharing an IP with one in the option. I just can't quite figure out what I need to do.