diff --git a/scripts/jobs/cron_traffic.inc.functions.php b/scripts/jobs/cron_traffic.inc.functions.php index 8b57e23b..c0170025 100644 --- a/scripts/jobs/cron_traffic.inc.functions.php +++ b/scripts/jobs/cron_traffic.inc.functions.php @@ -144,7 +144,7 @@ function awstatsDoSingleDomain($domain, $outputdir) return $returnval; } -function callAwstatsGetTraffic($domain, $outputdir, $caption, $usersdomainlist) +function callAwstatsGetTraffic($customerid, $outputdir, $usersdomainlist) { global $settings, $db, $cronlog; $returnval = 0; @@ -169,7 +169,6 @@ function callAwstatsGetTraffic($domain, $outputdir, $caption, $usersdomainlist) * a sane value for our panel_traffic and to remain the whole stats * (awstats overwrites the customers .html stats-files) */ - $customerid = getCustomerIdByDomain($domain); if($customerid !== false) { diff --git a/scripts/jobs/cron_traffic.php b/scripts/jobs/cron_traffic.php index dbe39df6..24509fb6 100644 --- a/scripts/jobs/cron_traffic.php +++ b/scripts/jobs/cron_traffic.php @@ -165,15 +165,11 @@ while($row = $db->fetch_array($result)) unset($domainlist[$row['customerid']][$domainid]); } - if($settings['system']['awstats_enabled'] == '1') - { - $httptraffic+= floatval(callAwstatsGetTraffic($domain, $row['documentroot'] . '/awstats/', $domain, $domainlist[$row['customerid']])); - } - else + if($settings['system']['awstats_enabled'] == '0') { $httptraffic+= floatval(callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']])); } - } + } } reset($domainlist[$row['customerid']]); @@ -183,9 +179,13 @@ while($row = $db->fetch_array($result)) safeSQLLogfile($domainlist[$row['customerid']], $row['loginname']); } + // callAwstatsGetTraffic is called ONLY HERE and + // *not* also in the special-logfiles-loop, because the function + // will iterate through all customer-domains and the awstats-configs + // know the logfile-name, #246 if($settings['system']['awstats_enabled'] == '1') { - $httptraffic+= floatval(callAwstatsGetTraffic($caption, $row['documentroot'] . '/awstats/', $caption, $domainlist[$row['customerid']])); + $httptraffic+= floatval(callAwstatsGetTraffic($row['customerid'], $row['documentroot'] . '/awstats/', $domainlist[$row['customerid']])); } else {