diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-09-10 09:21:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 09:21:28 +0300 |
commit | fb0d1563813aa7358b2e35e1b482f92c47c9b80a (patch) | |
tree | 27209daa1c086890047fd036aad8e5918c851c21 /plugins/SitesManager/API.php | |
parent | 6e35dfb52f4a22ecd82b2bb92198dd37e387d004 (diff) |
Remember user who created a site. (#13362)
* Remember user who created a site.
* Bump version & change column name to creator_login.
* Rename Site::getCreationUserFor
* Process sites like other methods in getPatternMatchSites().
* Update expected test files.
* update test again
Diffstat (limited to 'plugins/SitesManager/API.php')
-rw-r--r-- | plugins/SitesManager/API.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index 7abf627c75..a6256d7ab5 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -547,6 +547,11 @@ class API extends \Piwik\Plugin\API $name = Piwik::translate($key); $site['currency_name'] = ($key === $name) ? $site['currency'] : $name; + + // don't want to expose other user logins here + if (!Piwik::hasUserSuperUserAccess()) { + unset($site['creator_login']); + } } /** @@ -648,6 +653,8 @@ class API extends \Piwik\Plugin\API $bind['group'] = ""; } + $bind['creator_login'] = Piwik::getCurrentUserLogin(); + $allSettings = $this->setAndValidateMeasurableSettings(0, 'website', $coreProperties); // any setting specified in setting values will overwrite other setting @@ -1622,7 +1629,12 @@ class API extends \Piwik\Plugin\API $sites = $this->getModel()->getPatternMatchSites($ids, $pattern, $limit); + foreach ($sites as &$site) { + $this->enrichSite($site); + } + $sites = Site::setSitesFromArray($sites); + return $sites; } |