|
33 | 33 | # 1.4p2 implemented anonymization in error log part |
34 | 34 | # 1.4p3 implemented stronger anonymization |
35 | 35 | # 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) |
37 | 37 | # |
38 | 38 | # |
39 | 39 | # TODO: |
@@ -566,21 +566,21 @@ sub dump_tracker { |
566 | 566 | my $dbh = DBI->connect( $DBI_DSN, $DBI_USER, $DBI_PASS ) |
567 | 567 | or warn "DBI Error: $!"; |
568 | 568 | foreach my $key ( keys(%tracker) ) { |
569 | | - my $ts = time2str( "%m%d%Y", time() ); |
| 569 | + my $ts = time2str( "%Y-%m-%d", time() ); |
570 | 570 | 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 . "'" ); |
573 | 573 | $sth->execute; |
574 | 574 | if ( $sth->rows ) { |
575 | 575 | my $query = |
576 | | - "update wwwusage set bytes=bytes+" |
| 576 | + "update web_traffic set traffic_bytes=traffic_bytes+" |
577 | 577 | . $tracker{$key} |
578 | | - . " where vhost='" . $key |
579 | | - . "' and ldate='" . $ts . "'"; |
| 578 | + . " where hostname='" . $key |
| 579 | + . "' and traffic_date='" . $ts . "'"; |
580 | 580 | $dbh->do($query); |
581 | 581 | } |
582 | 582 | 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}')"; |
584 | 584 | $dbh->do($query); |
585 | 585 | } |
586 | 586 | } |
|
0 commit comments