Commit 59df847f authored by Marius Burkard's avatar Marius Burkard
Browse files

Merge branch 'rhel-pureftpd-logfile' into 'develop'

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

Closes #6378

See merge request ispconfig/ispconfig3!1625
parents 5bbec2b9 242b70ca
......@@ -30,10 +30,10 @@
<tmpl_loop name="records">
<tr>
<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_<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_<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_<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="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="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="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="last_year_in"}/{tmpl_var name="last_year_out"}</a></td>
<td class="text-right"></td>
</tr>
</tmpl_loop>
......
......@@ -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) {
......
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