3 # Display all header access control restrictions
5 require './squid-lib.pl';
6 $access{'headeracc'} || &error($text{'header_ecannot'});
7 &ui_print_header(undef, $text{'header_title'}, "", "list_headeracc", 0, 0, 0, &restart_button());
10 # Work out what header access directives we support
11 @types = $squid_version >= 3.0 ?
12 ("request_header_access", "reply_header_access") : ("header_access");
14 # Show a table for each
16 @headeracc = &find_config($t, $conf);
17 @links = ( "<a href='edit_headeracc.cgi?new=1&type=$t'>".
18 "$text{'header_add'}</a>" );
19 print &ui_subheading($text{'header_'.$t}),"<p>\n"
20 if ($t ne "header_access");
22 print &ui_links_row(\@links);
23 print &ui_columns_start([ $text{'header_name'},
26 $text{'eacl_move'} ]);
28 foreach $h (@headeracc) {
29 @v = @{$h->{'values'}};
31 push(@cols, "<a href='edit_headeracc.cgi?type=$t&".
32 "index=$h->{'index'}'>$v[0]</a>");
33 push(@cols, $v[1] eq 'allow' ? $text{'eacl_allow'}
34 : $text{'eacl_deny'});
35 push(@cols, join(" ", @v[2..$#v]));
36 push(@cols, &ui_up_down_arrows(
37 "move_headeracc.cgi?$hc+-1+$t",
38 "move_headeracc.cgi?$hc+1+$t",
39 $hc != 0, $hc != @headeracc-1));
40 print &ui_columns_row(\@cols);
43 print &ui_columns_end();
46 print "$text{'header_none'}<p>\n";
48 print &ui_links_row(\@links);
49 print "<hr>" if ($t ne $types[$#types]);
52 &ui_print_footer("", $text{'index_return'});