Skip to content

Commit

Permalink
Fixing mailtraffic cron, fixes traffic graph sorting
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
  • Loading branch information
Roman Schmerold (BNoiZe) committed Dec 22, 2013
1 parent 82f3d8d commit 429f748
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion customer_traffic.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
AND `month` = :month
AND `year` = :year
GROUP BY `day`
ORDER BY `day` ASC"
ORDER BY `day` DESC"
);
$params = array(
"customerid" => $userinfo['customerid'],
Expand Down
6 changes: 6 additions & 0 deletions lib/classes/mail/class.mailLogParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ private function _parseExim4Log($logFile) {
}
}
}
fclose($file_handle);
return true;
}


Expand Down Expand Up @@ -196,6 +198,8 @@ private function _parseDovecotLog($logFile) {
}
}
}
fclose($file_handle);
return true;
}


Expand Down Expand Up @@ -233,6 +237,8 @@ private function _parseCourierLog($logFile) {
}
}
}
fclose($file_handle);
return true;
}


Expand Down
4 changes: 1 addition & 3 deletions scripts/jobs/cron_traffic.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@
* MAIL-Traffic
*/
if (Settings::Get("system.mailtraffic_enabled")) {
$stmt = Database::prepare("SELECT lastrun FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `cronfile` = 'cron_traffic.php'");
$lastRunResult = Database::pexecute_first($stmt, array());
$mailTrafficCalc = new MailLogParser($lastRunResult['lastrun']);
$mailTrafficCalc = new MailLogParser(Settings::Get("system.last_traffic_run"));
}

$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` ORDER BY `customerid` ASC");
Expand Down
2 changes: 1 addition & 1 deletion templates/Froxlor/assets/js/traffic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(document).ready(function(){
var i = 1;
var links = [];
$('#datalegend').remove();
$('#datatable tr').each(function() {
$('#datatable tr').reverse().each(function() {
var row = $(this);
var day = $(row).children().first().text();
var ftpd = $(row).children().first().next().text();
Expand Down
2 changes: 1 addition & 1 deletion templates/Sparkle/assets/js/traffic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(document).ready(function(){
var i = 1;
var links = [];
$('#datalegend').remove();
$('#datatable tr').each(function() {
$('#datatable tr').reverse().each(function() {
var row = $(this);
var day = $(row).children().first().text();
var ftpd = $(row).children().first().next().text();
Expand Down

0 comments on commit 429f748

Please sign in to comment.