diff options
Diffstat (limited to 'app/Models/LogDAO.php')
| -rw-r--r-- | app/Models/LogDAO.php | 8 |
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', ''); + } } |
