comparison maltfilter @ 87:cbe5761897f4

Use ("No", "Queue", "Sent") for DroneBL information in status reports.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 30 Aug 2009 20:12:39 +0300
parents 4362bf9e52e4
children 3bcc17b754bf
comparison
equal deleted inserted replaced
86:4362bf9e52e4 87:cbe5761897f4
377 my @ipcolors = ( 377 my @ipcolors = (
378 "#666", 378 "#666",
379 "#777", 379 "#777",
380 ); 380 );
381 381
382 my @drone_status = ("No", "Queue", "Sent");
383
382 sub print_table2($$$$$$) 384 sub print_table2($$$$$$)
383 { 385 {
384 my ($m, $f, $table, $keys, $func, $class) = @_; 386 my ($m, $f, $table, $keys, $func, $class) = @_;
385 my $nhits = 0; 387 my $nhits = 0;
386 my $str = "<th>IP-address</th><th>Hits</th><th>DroneBL?</th><th>First hit</th><th>Latest hit</th><th>Class</th>"; 388 my $str = "<th>IP-address</th><th>Hits</th><th>DroneBL?</th><th>First hit</th><th>Latest hit</th><th>Class</th>";
403 405
404 printTD($m, $f, sprintf("%-15s", get_link($m, $_[0])), $str); 406 printTD($m, $f, sprintf("%-15s", get_link($m, $_[0])), $str);
405 printElem(!$m, $f, " | "); 407 printElem(!$m, $f, " | ");
406 printTD($m, $f, sprintf("%-8d ", $table->{$_[0]}{"hits"}), $blocked); 408 printTD($m, $f, sprintf("%-8d ", $table->{$_[0]}{"hits"}), $blocked);
407 printElem(!$m, $f, " | "); 409 printElem(!$m, $f, " | ");
408 printTD($m, $f, sprintf("%-6s ", $table->{$_[0]}{"dronebl"}), $blocked); 410 printTD($m, $f, sprintf("%-6s ", $drone_status[$table->{$_[0]}{"dronebl"}]), $blocked);
409 printElem(!$m, $f, " | "); 411 printElem(!$m, $f, " | ");
410 printTD($m, $f, get_ago_str($table->{$_[0]}{"date1"}), $blocked); 412 printTD($m, $f, get_ago_str($table->{$_[0]}{"date1"}), $blocked);
411 printElem(!$m, $f, " | "); 413 printElem(!$m, $f, " | ");
412 printTD($m, $f, get_ago_str($table->{$_[0]}{"date2"}), $blocked); 414 printTD($m, $f, get_ago_str($table->{$_[0]}{"date2"}), $blocked);
413 printElem(!$m, $f, " | "); 415 printElem(!$m, $f, " | ");
588 $statlist{$ip}{"dronebl"} = 2 if defined($statlist{$ip}); 590 $statlist{$ip}{"dronebl"} = 2 if defined($statlist{$ip});
589 } 591 }
590 } elsif ($type eq "error") { 592 } elsif ($type eq "error") {
591 # If we don't have a valid key, disable further submissions. 593 # If we don't have a valid key, disable further submissions.
592 if ($msg =~ /<code>403<\/code>/) { 594 if ($msg =~ /<code>403<\/code>/) {
593 mlog(-1, "Disabling DroneBL submission due to invalid key.\n"); 595 mlog(-1, "[DroneBL] Disabling submissions due to invalid key.\n");
594 $settings{"DRONEBL"} = 0; 596 $settings{"DRONEBL"} = 0;
595 } else { 597 } else {
596 $dronebl_errors++; 598 $dronebl_errors++;
597 } 599 }
598 # Log error message mangled 600 # Log error message mangled