A free, self-hostable news aggregator…
Fix a bug to get size of user (SQLite)
Marien Fressinaud5797344aff9c
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.phpindex 4a04737f2..d5c90a382 100644--- a/app/Controllers/userController.php+++ b/app/Controllers/userController.php@@ -94,14 +94,15 @@ class FreshRSS_user_Controller extends Minz_ActionController {Minz_View::prependTitle(_t('users.manage') . ' · ');+ // Get the correct current user.$userDAO = new FreshRSS_UserDAO();-$username = Minz_Request::param('u', Minz_Session::param('currentUser'));if (!$userDAO->exist($username)) {$username = Minz_Session::param('currentUser');}$this->view->current_user = $username;+ // Get information about the current user.$entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user);$this->view->nb_articles = $entryDAO->count();$this->view->size_user = $entryDAO->size();diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.phpindex 66078aca9..4a3fe24a2 100644--- a/app/Models/EntryDAOSQLite.php+++ b/app/Models/EntryDAOSQLite.php@@ -124,6 +124,6 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {}public function size($all = false) {- return @filesize(DATA_PATH . '/' . Minz_Session::param('currentUser', '_') . '.sqlite');+ return @filesize(DATA_PATH . '/' . $this->current_user . '.sqlite');}}diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.phpindex 66127ea22..827c89c69 100644--- a/lib/Minz/ModelPdo.php+++ b/lib/Minz/ModelPdo.php@@ -24,6 +24,7 @@ class Minz_ModelPdo {*/protected $bd;+ protected $current_user;protected $prefix;public function dbType() {@@ -46,6 +47,7 @@ class Minz_ModelPdo {if ($currentUser === null) {$currentUser = Minz_Session::param('currentUser', '_');}+ $this->current_user = $currentUser;try {$type = $db['type'];