Hide matomo users who have access to a site but not made by AlternC

Users made in the Matomo interface and given an access to a site
that's in AlternC show up without this restriction. When that happens,
the user is no longer able to modify permissions for any of the Matomo
users from their AlternC account.
This commit is contained in:
Kienan Stewart 2019-12-18 17:08:59 -05:00 committed by Camille Lafitte
parent c95dd63c26
commit e028b15e7b
1 changed files with 6 additions and 0 deletions

View File

@ -165,6 +165,12 @@ class m_piwik {
$api_data->$user = 'noaccess';
}
}
# Hide users who have access, but are not in AlternC
foreach (get_object_vars($api_data) as $user => $access) {
if (!in_array($user, $this->alternc_users)) {
unset($api_data->$user);
}
}
return $api_data;
}
else return FALSE;