-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlogs_main.cgi
executable file
·53 lines (40 loc) · 1.33 KB
/
logs_main.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/perl
# Copyright (C) 2003-2019
# Emmanuel Saracco <emmanuel@esaracco.fr>
#
# GNU GENERAL PUBLIC LICENSE
require './clamav-lib.pl';
&clamav_check_acl ('logs_viewer_view');
&ReadParse ();
my ($_success, $_error) = ('', '');
&clamav_header ($text{'LINK_LOGS'});
print qq(<form method="POST" action="$scriptname">);
print qq(<p>$text{'LOGS_PAGE_DESCRIPTION'}</p>);
print qq($text{'DISPLAY'} );
print qq(<select name="lines">);
printf "<option value=\"0\"%s>%s</option>",
(!$in{'lines'}) ? ' selected="selected"' : '', $text{'ALL'};
foreach $value (qw(10 20 50 100 150 200 250 300))
{
printf "<option value=\"%s\"%s>%s</option>",
$value, ($in{'lines'} eq $value) ? ' selected="selected"' : '', $value;
}
print qq(</select>);
print qq( $text{'LINES_OF'} );
@logs = &clamav_get_logfiles ();
print qq(<select name="logfile">);
foreach $log (@logs)
{
printf ("<option value=\"%s\"%s>%s</option>",
$log,
($log eq $in{'logfile'}) ? ' selected="selected"' : '',
$log
);
}
print qq(</select>);
print qq(<p/>);
print qq(<div><button type="submit" class="btn btn-success ui_form_end_submit"><i class="fa fa-fw fa-search"></i> <span>$text{'DISPLAY'}</span></button></div>);
print qq(</form>);
print qq(<p/>);
&clamav_print_log ($in{'logfile'}, $in{'lines'});
&clamav_footer ('', $text{'RETURN_INDEX_MODULE'}, $_success, $_error);