diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-07-20 15:11:20 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-07-20 15:11:20 +0400 |
commit | 3dddcfd0a19359c576b4797ffe9eed17c57fd69f (patch) | |
tree | 336143e3e963533c8dd224c64df1e489fcf9b303 /core/Access.php | |
parent | 332e43403992cc114a21cb03aa8296a9a8da16d8 (diff) |
Remove use of globals when non-intrusively setting up test environment and add use of test events.
Diffstat (limited to 'core/Access.php')
-rw-r--r-- | core/Access.php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/core/Access.php b/core/Access.php index 33952f943e..b7e2294a22 100644 --- a/core/Access.php +++ b/core/Access.php @@ -46,9 +46,7 @@ class Piwik_Access if (self::$instance == null) { self::$instance = new self; - if (!empty($GLOBALS['PIWIK_ACCESS_IS_SUPERUSER'])) { - self::$instance->setSuperUser(true); - } + Piwik_PostTestEvent('Access.createAccessSingleton', array(self::$instance)); } return self::$instance; } @@ -213,12 +211,9 @@ class Piwik_Access $allSitesId = array(); } $this->idsitesByAccess['superuser'] = $allSitesId; - - if (isset($GLOBALS['PIWIK_ACCESS_SUPERUSER_LOGIN'])) { - $this->login = $GLOBALS['PIWIK_ACCESS_SUPERUSER_LOGIN']; - } else { - $this->login = Piwik_Config::getInstance()->superuser['login']; - } + $this->login = Piwik_Config::getInstance()->superuser['login']; + + Piwik_PostTestEvent('Access.loadingSuperUserAccess', array(&$this->idsitesByAccess, &$this->login)); return true; } |