Revision cd8155b1
Added by N0YB over 12 years ago
etc/inc/filter_log.inc | ||
---|---|---|
71 | 71 |
$flent = parse_filter_line($logent); |
72 | 72 |
if (!$filterinterface || ($filterinterface == $flent['interface'])) |
73 | 73 |
{ |
74 |
if (($flent != "") && (match_filter_line($flent, $filtertext))) { |
|
74 |
if ( ( ($flent != "") && (!is_array($filtertext)) && (match_filter_line ($flent, $filtertext))) || |
|
75 |
( ($flent != "") && ( is_array($filtertext)) && (match_filter_field($flent, $filtertext)) ) ) { |
|
75 | 76 |
$counter++; |
76 | 77 |
$filterlog[] = $flent; |
77 | 78 |
} |
... | ... | |
88 | 89 |
return preg_match("/{$filtertext}/i", implode(" ", array_values($flent))); |
89 | 90 |
} |
90 | 91 |
|
92 |
function match_filter_field($flent, $fields) { |
|
93 |
foreach ($fields as $field) { |
|
94 |
if ($fields[$field] == "All") continue; |
|
95 |
if ( !(in_arrayi($flent[$field], explode(",", str_replace(" ", ",", $fields[$field]))) ) ) return false; |
|
96 |
} |
|
97 |
return true; |
|
98 |
} |
|
99 |
|
|
100 |
// Case Insensitive in_array function |
|
101 |
function in_arrayi($needle, $haystack) { |
|
102 |
return in_array(strtolower($needle), array_map('strtolower', $haystack)); |
|
103 |
} |
|
104 |
|
|
91 | 105 |
function collapse_filter_lines($logarr) { |
92 | 106 |
$lastline = ""; |
93 | 107 |
$collapsed = array(); |
Also available in: Unified diff
Update etc/inc/filter_log.inc
Firewall Logs Widget FilteringOptions to filter on interfaces, 'pass', 'block', & 'reject'