3 # Display logging search form
7 require './webminlog-lib.pl';
8 our (%text, %gconfig, %access_users, %in, %config);
9 &foreign_require("acl", "acl-lib.pl");
10 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
12 if (!$gconfig{'log'}) {
13 print &text('index_nolog', '/webmin/edit_log.cgi'),"<p>\n";
15 elsif (!$gconfig{'logfiles'}) {
16 print &text('index_nologfiles', '/webmin/edit_log.cgi'),"<p>\n";
19 print &ui_form_start("search.cgi");
20 print &ui_table_start($text{'index_header'}, undef, 2);
22 my @ulist = sort { $a->{'name'} cmp $b->{'name'} } &acl::list_users();
23 my @canulist = grep { &can_user($_->{'name'}) } @ulist;
25 # Can only show one user, so skip this field
26 print &ui_hidden("uall", 1),"\n";
30 my @unames = grep { &can_user($_) } map { $_->{'name'} } @ulist;
31 my @opts = ( [ 1, $text{'index_uall'}."<br>" ],
32 [ 0, $text{'index_user'}." ".
33 &ui_select("user", undef, \@unames)."<br>" ] );
34 if ($access_users{'*'}) {
35 push(@opts, [ 2, $text{'index_nuser'}." ".
36 &ui_select("nuser", undef, \@unames)."<br>" ]);
37 push(@opts, [ 3, $text{'index_ouser'}." ".
38 &ui_textbox("ouser", undef, 20) ]);
40 print &ui_table_row($text{'index_susers'},
41 &ui_radio("uall", 1, \@opts));
46 if (&can_mod("global")) {
47 push(@mods, [ "global", $text{'index_global'} ]);
49 foreach my $m (sort { $a->{'desc'} cmp $b->{'desc'} } &get_all_module_infos()) {
50 next if (!&can_mod($m->{'dir'}));
51 my $mdir = &module_root_directory($m->{'dir'});
52 if (-r "$mdir/log_parser.pl" && &check_os_support($m)) {
53 push(@mods, [ $m->{'dir'}, $m->{'desc'} ]);
56 my @opts = ( [ 1, $text{'index_mall'}."<br>" ],
57 [ 0, $text{'index_module'}." ".
58 &ui_select("module", $in{'module'}, \@mods) ] );
59 print &ui_table_row($text{'index_smods'},
60 &ui_radio("mall", 1, \@opts));
63 print &ui_table_row($text{'index_stimes'},
65 [ [ 1, $text{'index_tall'}."<br>" ],
66 [ 2, $text{'index_today'}."<br>" ],
67 [ 3, $text{'index_yesterday'}."<br>" ],
68 [ 4, $text{'index_week'}."<br>" ],
69 [ 0, &text('index_time', &time_input('from'),
70 &time_input('to')) ] ]));
72 # Search modified files and diff contents
73 if ($gconfig{'logfiles'}) {
74 print &ui_table_row($text{'index_sfile'},
76 [ [ 1, $text{'index_fall'}."<br>" ],
77 [ 0, $text{'index_file'}." ".
78 &ui_textbox("file", undef, 40) ] ]));
80 print &ui_table_row($text{'index_sdiff'},
82 [ [ 1, $text{'index_dall'}."<br>" ],
83 [ 0, $text{'index_diff'}." ".
84 &ui_textbox("diff", undef, 40) ] ]));
88 if ($config{'host_search'}) {
89 print &ui_table_row($text{'index_shost'},
91 [ [ 1, $text{'index_wall'}."<br>" ],
92 [ 0, $text{'index_whost'}." ".
93 &ui_textbox("webmin", undef, 30) ] ]));
96 # Show full descriptions?
97 print &ui_table_row($text{'index_long'},
98 &ui_yesno_radio("long", 0));
100 print &ui_table_end();
101 print &ui_form_end([ [ undef, $text{'index_search'} ] ]);
103 &ui_print_footer("/", $text{'index'});
108 return &ui_date_input(undef, undef, undef,
109 $name."_d", $name."_m", $name."_y").
110 &date_chooser_button($name."_d", $name."_m", $name."_y");