From 242b70ca01d3c51b9eb046b898d145466254f3d2 Mon Sep 17 00:00:00 2001 From: Michael Seevogel Date: Sun, 14 Aug 2022 11:23:52 +0200 Subject: [PATCH] - Check for different pure-ftpd log file locations (fixes FTP stats for EPEL/RHEL) - Updated edit links in html template --- .../web/sites/templates/ftp_sites_stats_list.htm | 8 ++++---- server/lib/classes/cron.d/200-ftplogfiles.inc.php | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/interface/web/sites/templates/ftp_sites_stats_list.htm b/interface/web/sites/templates/ftp_sites_stats_list.htm index 9474bb2fda..f6739552fc 100644 --- a/interface/web/sites/templates/ftp_sites_stats_list.htm +++ b/interface/web/sites/templates/ftp_sites_stats_list.htm @@ -30,10 +30,10 @@ {tmpl_var name="domain"} - {tmpl_var name="this_month_in"}/{tmpl_var name="this_month_out"} - {tmpl_var name="last_month_in"}/{tmpl_var name="last_month_out"} - {tmpl_var name="this_year_in"}/{tmpl_var name="this_year_out"} - {tmpl_var name="last_year_in"}/{tmpl_var name="last_year_out"} + {tmpl_var name="this_month_in"}/{tmpl_var name="this_month_out"} + {tmpl_var name="last_month_in"}/{tmpl_var name="last_month_out"} + {tmpl_var name="this_year_in"}/{tmpl_var name="this_year_out"} + {tmpl_var name="last_year_in"}/{tmpl_var name="last_year_out"} diff --git a/server/lib/classes/cron.d/200-ftplogfiles.inc.php b/server/lib/classes/cron.d/200-ftplogfiles.inc.php index 36b4335240..a88a360ae2 100644 --- a/server/lib/classes/cron.d/200-ftplogfiles.inc.php +++ b/server/lib/classes/cron.d/200-ftplogfiles.inc.php @@ -32,7 +32,17 @@ class cronjob_ftplogfiles extends cronjob { // Make the ftp logfiles directories world readable to enable ftp access //###################################################################################################### - if(is_dir('/var/log/pure-ftpd/')) exec('chmod +r /var/log/pure-ftpd/*'); + $logfile = null; + + if(is_dir('/var/log/pure-ftpd/')) { + exec('chmod +r /var/log/pure-ftpd/*'); + $logfile="/var/log/pure-ftpd/transfer.log.1"; + } elseif(is_file('/var/log/pureftpd.log')) { + $logfile="/var/log/pureftpd.log"; + } else { + $app->log("The pure-ftpd log file could not be found.", LOGLEVEL_DEBUG); + return false; + } //###################################################################################################### // Manage and compress ftp logfiles and create traffic statistics @@ -71,7 +81,7 @@ class cronjob_ftplogfiles extends cronjob { } } - $fp = @fopen('/var/log/pure-ftpd/transfer.log.1', 'r'); + $fp = @fopen($logfile, 'r'); $ftp_traffic = array(); if ($fp) { -- GitLab