#!/usr/local/bin/perl # A form for editing or creating a header access control rule require './squid-lib.pl'; $access{'headeracc'} || &error($text{'header_ecannot'}); &ReadParse(); $conf = &get_config(); if (!defined($in{'index'})) { &ui_print_header(undef, $text{'header_create_'.$in{'type'}} || $text{'header_create'}, "", undef, 0, 0, 0, &restart_button()); } else { &ui_print_header(undef, $text{'header_edit_'.$in{'type'}} || $text{'header_edit'}, "", undef, 0, 0, 0, &restart_button()); @v = @{$conf->[$in{'index'}]->{'values'}}; } print "
\n"; if (@v) { print "\n"; } print &ui_hidden("type", $in{'type'}); print "\n"; print "\n"; print "
$text{'header_header'}
\n"; print "\n", $v[0]; print "\n", $v[1] eq "allow" ? "" : "checked"; for($i=2; $i<@v; $i++) { $match{$v[$i]}++; } @acls = grep { !$done{$_->{'values'}->[0]}++ } &find_config("acl", $conf); unshift(@acls, { 'values' => [ 'all' ] }) if ($squid_version >= 3); $r = @acls; $r = 10 if ($r > 10); print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'header_name'} \n"; printf "
$text{'ahttp_a'} \n"; printf " $text{'ahttp_a1'}\n", $v[1] eq "allow" ? "checked" : ""; printf " $text{'ahttp_d'}
$text{'ahttp_ma'}$text{'ahttp_dma'}
\n"; print "\n"; if (@v) { print "\n"; } print "
\n"; &ui_print_footer("list_headeracc.cgi", $text{'header_return'}, "", $text{'index_return'});