Commit 242b70ca authored by Michael Seevogel's avatar Michael Seevogel
Browse files

- Check for different pure-ftpd log file locations (fixes FTP stats for EPEL/RHEL)

- Updated edit links in html template
parent 5bbec2b9
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
<tmpl_loop name="records"> <tmpl_loop name="records">
<tr> <tr>
<td><a target="_blank" href="http://{tmpl_var name="domain"}/stats">{tmpl_var name="domain"}</a></td> <td><a target="_blank" href="http://{tmpl_var name="domain"}/stats">{tmpl_var name="domain"}</a></td>
<td><a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="this_month_in"}/{tmpl_var name="this_month_out"}</a></td> <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="this_month_in"}/{tmpl_var name="this_month_out"}</a></td>
<td><a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="last_month_in"}/{tmpl_var name="last_month_out"}</a></td> <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="last_month_in"}/{tmpl_var name="last_month_out"}</a></td>
<td><a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="this_year_in"}/{tmpl_var name="this_year_out"}</a></td> <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="this_year_in"}/{tmpl_var name="this_year_out"}</a></td>
<td><a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="last_year_in"}/{tmpl_var name="last_year_out"}</a></td> <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="last_year_in"}/{tmpl_var name="last_year_out"}</a></td>
<td class="text-right"></td> <td class="text-right"></td>
</tr> </tr>
</tmpl_loop> </tmpl_loop>
......
...@@ -32,7 +32,17 @@ class cronjob_ftplogfiles extends cronjob { ...@@ -32,7 +32,17 @@ class cronjob_ftplogfiles extends cronjob {
// Make the ftp logfiles directories world readable to enable ftp access // 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 // Manage and compress ftp logfiles and create traffic statistics
...@@ -71,7 +81,7 @@ class cronjob_ftplogfiles extends cronjob { ...@@ -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(); $ftp_traffic = array();
if ($fp) { if ($fp) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment