aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-30 15:00:41 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-30 15:00:41 +0100
commitbd5d7a7bcb16cff1c01f4445ceee765fc11e3b50 (patch)
tree1839dbb208d1b63c034fce2cb3d646124a6c937c /app/Models
parent4d6ab45b03031e1c13ac2d3589364a43a0fe5578 (diff)
Cache HTTP compatible multi-utilisateur
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/LogDAO.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/LogDAO.php b/app/Models/LogDAO.php
index 6205468bd..d1e515200 100644
--- a/app/Models/LogDAO.php
+++ b/app/Models/LogDAO.php
@@ -1,9 +1,9 @@
<?php
class FreshRSS_LogDAO {
- public static function lines($user) {
+ public static function lines() {
$logs = array ();
- $handle = @fopen(LOG_PATH . '/' . $user . '.log', 'r');
+ $handle = @fopen(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log', 'r');
if ($handle) {
while (($line = fgets($handle)) !== false) {
if (preg_match ('/^\[([^\[]+)\] \[([^\[]+)\] --- (.*)$/', $line, $matches)) {
@@ -18,4 +18,8 @@ class FreshRSS_LogDAO {
}
return array_reverse($logs);
}
+
+ public static function truncate() {
+ file_put_contents(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log', '');
+ }
}