fix callGoaccessGetTraffic parameters

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-03 11:17:02 +01:00
parent 2698a730eb
commit 1bf9b38cfb

View File

@@ -224,7 +224,7 @@ class TrafficCron extends FroxlorCron
if ($statsTool != 'awstats') {
foreach ($speciallogfile_domainlist[$row['customerid']] as $domainid => $domain) {
if ($statsTool == 'goaccess') {
$httptraffic += floatval(self::callGoaccessGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/goaccess/' . $domain . '/', $domain, $domainlist[$row['customerid']], ['month' => $current_month_short, 'year' => $current_year]));
$httptraffic += floatval(self::callGoaccessGetTraffic($row['customerid'], $row['loginname'] . '-' . $domain, $row['documentroot'] . '/goaccess/' . $domain . '/', $domain, ['month' => $current_month_short, 'year' => $current_year], $current_stamp));
} else {
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']]));
}
@@ -241,7 +241,7 @@ class TrafficCron extends FroxlorCron
if ($statsTool == 'awstats') {
$httptraffic += floatval(self::callAwstatsGetTraffic($row['customerid'], $row['documentroot'] . '/awstats/', $domainlist[$row['customerid']], $current_stamp));
} elseif ($statsTool == 'goaccess') {
$httptraffic += floatval(self::callGoaccessGetTraffic($row['customerid'], $row['loginname'], $row['documentroot'] . '/goaccess/', $caption, $domainlist[$row['customerid']], ['month' => $current_month_short, 'year' => $current_year]));
$httptraffic += floatval(self::callGoaccessGetTraffic($row['customerid'], $row['loginname'], $row['documentroot'] . '/goaccess/', $caption, ['month' => $current_month_short, 'year' => $current_year], $current_stamp));
} else {
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']]));
}
@@ -625,11 +625,12 @@ class TrafficCron extends FroxlorCron
* @param string $logfile Name of logfile
* @param string $outputdir Place where stats should be build
* @param string $caption Caption for webalizer output
* @param array $usersdomainlist
* @param array $monthyear_arr
* @param int $current_stamp
*
* @return int Used traffic
*/
private static function callGoaccessGetTraffic($customerid, $logfile, $outputdir, $caption, array $usersdomainlist = [], array $monthyear_arr = [])
private static function callGoaccessGetTraffic($customerid, $logfile, $outputdir, $caption, array $monthyear_arr = [], int $current_stamp = 0)
{
$returnval = 0;