Skip to content

Commit 4188c22

Browse files
author
Marius Burkard
committed
- backported some more code from old vlogger
1 parent 5b051c9 commit 4188c22

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/scripts/vlogger

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# 1.4p2 implemented anonymization in error log part
3434
# 1.4p3 implemented stronger anonymization
3535
# 1.4p4 implemented re-opening on externally rotated error.log
36-
# 1.4p5 backported old ISPConfig changes (improved DBI error handling)
36+
# 1.4p5 backported old ISPConfig changes (improved DBI error handling, naming)
3737
#
3838
#
3939
# TODO:
@@ -566,21 +566,21 @@ sub dump_tracker {
566566
my $dbh = DBI->connect( $DBI_DSN, $DBI_USER, $DBI_PASS )
567567
or warn "DBI Error: $!";
568568
foreach my $key ( keys(%tracker) ) {
569-
my $ts = time2str( "%m%d%Y", time() );
569+
my $ts = time2str( "%Y-%m-%d", time() );
570570
my $sth =
571-
$dbh->prepare( "select * from wwwusage where vhost='" . $key
572-
. "' and ldate='" . $ts . "'" );
571+
$dbh->prepare( "select * from web_traffic where hostname='" . $key
572+
. "' and traffic_date='" . $ts . "'" );
573573
$sth->execute;
574574
if ( $sth->rows ) {
575575
my $query =
576-
"update wwwusage set bytes=bytes+"
576+
"update web_traffic set traffic_bytes=traffic_bytes+"
577577
. $tracker{$key}
578-
. " where vhost='" . $key
579-
. "' and ldate='" . $ts . "'";
578+
. " where hostname='" . $key
579+
. "' and traffic_date='" . $ts . "'";
580580
$dbh->do($query);
581581
}
582582
else {
583-
my $query = "insert into wwwusage (vhost, ldate, bytes) values ('$key', '$ts', '$tracker{$key}')";
583+
my $query = "insert into web_traffic (hostname, traffic_date, traffic_bytes) values ('$key', '$ts', '$tracker{$key}')";
584584
$dbh->do($query);
585585
}
586586
}

0 commit comments

Comments
 (0)