2 # Show allowed and denied lists
4 require './tcpwrappers-lib.pl';
6 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
9 @types = ('allow', 'deny');
11 [ map { [ $_, $text{'index_'.$_.'title'},
12 "index.cgi?type=$_" ] } @types ],
14 $in{'type'} || "allow",
18 foreach my $type ('allow', 'deny') {
19 print &ui_tabs_start_tab("type", $type);
20 my $file = $type eq 'allow' ? $config{'hosts_allow'}
21 : $config{'hosts_deny'};
22 @rules = &list_rules($file);
26 foreach my $r (@rules) {
28 { 'type' => 'checkbox', 'name' => 'd',
29 'value' => $r->{'id'} },
30 "<a href='edit_rule.cgi?$type=1&id=$r->{'id'}'>".
31 "$r->{'service'}</a>",
33 $r->{'cmd'} ? join("<br>", split /:/, $r->{'cmd'})
34 : $text{'index_none'},
39 print &ui_form_columns_table(
41 [ [ "delete", $text{'index_delete'} ] ],
43 [ [ "edit_rule.cgi?$type=1&new=1", $text{'index_add'} ] ],
45 [ "", $text{'index_service'},
46 $text{'index_hosts'}, $text{'index_cmd'}, ],
52 &text('index_norule', $file),
54 print &ui_tabs_end_tab("type", $type);
57 print &ui_tabs_end(1);
59 &ui_print_footer("/", $text{'index_return'});