From e028b15e7b99561100ff4aafad2450d808d42981 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 18 Dec 2019 17:08:59 -0500 Subject: [PATCH] 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. --- bureau/class/m_piwik.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bureau/class/m_piwik.php b/bureau/class/m_piwik.php index 67ad88cf..b4c42ff0 100644 --- a/bureau/class/m_piwik.php +++ b/bureau/class/m_piwik.php @@ -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;