diff options
author | johmathe <johmathe@google.com> | 2008-08-16 22:14:26 +0400 |
---|---|---|
committer | johmathe <johmathe@google.com> | 2008-08-16 22:14:26 +0400 |
commit | 4f4ac903acfa597fc16ac947ea14bc491840f667 (patch) | |
tree | fa63b2b865cf5622f4611c33154fecd05579e055 /plugins/DBStats/API.php | |
parent | fa5d01ad821179ac3cb8b6d515308624d0374fac (diff) |
Corrects an permissions bug for the db statistics access.
git-svn-id: http://dev.piwik.org/svn/trunk@608 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/DBStats/API.php')
-rw-r--r-- | plugins/DBStats/API.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/DBStats/API.php b/plugins/DBStats/API.php index a05d5d0144..d65f826ef4 100644 --- a/plugins/DBStats/API.php +++ b/plugins/DBStats/API.php @@ -28,9 +28,8 @@ class Piwik_DBStats_API extends Piwik_Apiable static public function getDBStatus() { - Piwik::isUserIsSuperUser(); - $configDb = Piwik_Config::getInstance()->database; - + Piwik::checkUserIsSuperUser(); + $configDb = Zend_Registry::get('config')->database->toArray(); // we decode the password. Password is html encoded because it's enclosed between " double quotes $configDb['password'] = htmlspecialchars_decode($configDb['password']); if(!isset($configDb['port'])) @@ -46,7 +45,7 @@ class Piwik_DBStats_API extends Piwik_Apiable } static private function get_size($size) { - $bytes = array('B','KB','MB','GB','TB'); + $bytes = array('','K','M','G','T'); foreach($bytes as $val) { if($size > 1024){ $size = $size / 1024; @@ -59,7 +58,7 @@ class Piwik_DBStats_API extends Piwik_Apiable static public function getTableStatus($table, $field = '') { - Piwik::isUserIsSuperUser(); + Piwik::checkUserIsSuperUser(); $db = Zend_Registry::get('db'); // http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html $tables = $db->fetchAll("SHOW TABLE STATUS LIKE ?", $table); |