diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-10-22 07:54:14 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-10-22 07:54:14 +0400 |
commit | 9425c0f6d0134a65b0e22d9971923d03f83dcfa8 (patch) | |
tree | f1adb401876c81de41eb99e3afe6f3e2156d3ecc /core/Piwik.php | |
parent | a10375e68a971accfc3921e22f64986c5fe52b58 (diff) |
Refactor isUserIsAnonymous
Diffstat (limited to 'core/Piwik.php')
-rw-r--r-- | core/Piwik.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/Piwik.php b/core/Piwik.php index f8d6df175e..625a7cf9f8 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -189,7 +189,12 @@ class Piwik */ public static function getCurrentUserLogin() { - return Access::getInstance()->getLogin(); + $login = Access::getInstance()->getLogin(); + + if(empty($login)) { + return 'anonymous'; + } + return $login; } /** @@ -296,7 +301,8 @@ class Piwik */ public static function isUserIsAnonymous() { - return Piwik::getCurrentUserLogin() == 'anonymous'; + $currentUserLogin = Piwik::getCurrentUserLogin(); + return $currentUserLogin == 'anonymous'; } /** |