From 3cc073f2d1dd4a5fef5d66e6f30c4496bf2e6421 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 30 Dec 2013 12:39:21 +0100 Subject: Log compatible multi-utilisateur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126. Il faudra restaurer la gestion du cache HTTP pour les logs --- app/Controllers/indexController.php | 4 ++-- app/Models/LogDAO.php | 6 ++---- lib/Minz/Log.php | 4 ++-- p/i/index.php | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 66809964d..cc851a1fa 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -218,10 +218,10 @@ class FreshRSS_index_Controller extends Minz_ActionController { Minz_View::prependTitle (Minz_Translate::t ('logs') . ' - '); if (Minz_Request::isPost ()) { - file_put_contents(LOG_PATH . '/application.log', ''); + file_put_contents(LOG_PATH . '/' . Minz_Configuration::currentUser() . '.log', ''); //Truncate } - $logs = FreshRSS_LogDAO::lines(); //TODO: ask only the necessary lines + $logs = FreshRSS_LogDAO::lines(Minz_Configuration::currentUser()); //TODO: ask only the necessary lines //gestion pagination $page = Minz_Request::param ('page', 1); diff --git a/app/Models/LogDAO.php b/app/Models/LogDAO.php index e57e0b1b9..6205468bd 100644 --- a/app/Models/LogDAO.php +++ b/app/Models/LogDAO.php @@ -1,11 +1,9 @@ = Minz_Log::NOTICE)))) { - if (is_null ($file_name)) { - $file_name = LOG_PATH . '/application.log'; + if ($file_name === null) { + $file_name = LOG_PATH . '/' . Minz_Configuration::currentUser() . '.log'; } switch ($level) { diff --git a/p/i/index.php b/p/i/index.php index 6c25b2c54..8d9343a30 100755 --- a/p/i/index.php +++ b/p/i/index.php @@ -28,7 +28,6 @@ if (file_exists ('install.php')) { require (LIB_PATH . '/http-conditional.php'); $dateLastModification = max( @filemtime(DATA_PATH . '/touch.txt'), - @filemtime(LOG_PATH . '/application.log'), @filemtime(DATA_PATH . '/config.php') ); $_SERVER['QUERY_STRING'] .= '&utime=' . file_get_contents(DATA_PATH . '/touch.txt'); //For ETag -- cgit v1.2.3