From bda7796e8ffa5a75ef69d21dce5af74c04d29777 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 22 Jan 2014 23:52:44 +0000 Subject: [PATCH] refs #4564 also check for the config user --- core/Piwik.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/Piwik.php b/core/Piwik.php index ca9e63b9440..d7baa85d6ee 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -306,13 +306,21 @@ static public function checkUserIsSuperUserOrTheUser($theUser) static public function hasTheUserSuperUserAccess($theUser) { + if (empty($theUser)) { + return false; + } + + if (Piwik::getConfigSuperUserLogin() === $theUser) { + return true; + } + try { $superUserLogins = APIUsersManager::getInstance()->getUsersLoginHavingSuperUserAccess(); } catch (\Exception $e) { $superUserLogins = array(); } - return !empty($theUser) && in_array($theUser, $superUserLogins); + return in_array($theUser, $superUserLogins); } /**