\n"; } # Form to add a new ACL print &ui_form_start("acl.cgi"); print &ui_submit($text{'eacl_buttcreate'}); print &ui_select("type", undef, [ map { [ $_, $acl_types{$_} ] } (sort { $acl_types{$a} cmp $acl_types{$b} } keys %acl_types) ]); print &ui_form_end(); print &ui_tabs_end_tab(); # List all HTTP restrictions, based on ACLs print &ui_tabs_start_tab("mode", "http"); my @http = &find_config("http_access", $conf); if (@http) { my @tds = ( "width=5", "width=10%", undef, "width=32" ); print &ui_form_start("delete_http_accesses.cgi", "post"); print &ui_links_row([ &ui_link("http_access.cgi?new=1", $text{'eacl_addpr'}) ]); print &ui_columns_start([ "", $text{'eacl_act'}, $text{'eacl_acls1'}, $text{'eacl_move'} ], 100, 0, \@tds); my $hc = 0; foreach my $h (@http) { my @v = @{$h->{'values'}}; if ($v[0] eq "allow") { $v[0] = $text{'eacl_allow'}; } else { $v[0] = $text{'eacl_deny'}; } my @cols; push(@cols, &ui_link("http_access.cgi?index=$h->{'index'}", $v[0])); push(@cols, &html_escape(join(' ', @v[1..$#v]))); my $mover = &ui_up_down_arrows( "move_http.cgi?$hc+-1", "move_http.cgi?$hc+1", $hc != 0, $hc != @http-1 ); push(@cols, $mover); print &ui_checked_columns_row(\@cols, \@tds, "d",$h->{'index'}); $hc++; } print &ui_columns_end(); print &ui_links_row([ &ui_link("http_access.cgi?new=1", $text{'eacl_addpr'}) ]); print &ui_form_end([ [ "delete", $text{'eacl_hdelete'} ] ]); } else { print "$text{'eacl_nopr'}
\n"; print &ui_links_row([ &ui_link("http_access.cgi?new=1", $text{'eacl_addpr'}) ]); } print &ui_tabs_end_tab(); # List all ICP restrictions, based on ACLs print &ui_tabs_start_tab("mode", "icp"); my @icp = &find_config("icp_access", $conf); if (@icp) { print &ui_form_start("delete_icp_accesses.cgi", "post"); my @tds = ( "width=5", "width=10%", undef, "width=32" ); print &ui_links_row([ &ui_link("icp_access.cgi?new=1", $text{'eacl_addicpr'}) ]); print &ui_columns_start([ "", $text{'eacl_act'}, $text{'eacl_acls1'}, $text{'eacl_move'} ], 100, 0, \@tds); my $ic = 0; foreach my $i (@icp) { my @v = @{$i->{'values'}}; if ($v[0] eq "allow") { $v[0] = $text{'eacl_allow'}; } else { $v[0] = $text{'eacl_deny'}; } my @cols; push(@cols, &ui_link("icp_access.cgi?index=$i->{'index'}", $v[0])); push(@cols, &html_escape(join(' ', @v[1..$#v]))); my $mover = &ui_up_down_arrows( "move_icp.cgi?$ic+-1", "move_icp.cgi?$ic+1", $ic != 0, $ic != @icp-1); push(@cols, $mover); print &ui_checked_columns_row(\@cols, \@tds, "d",$i->{'index'}); $ic++; } print &ui_columns_end(); print &ui_links_row([ &ui_link("icp_access.cgi?new=1", $text{'eacl_addicpr'}) ]); print &ui_form_end([ [ "delete", $text{'eacl_hdelete'} ] ]); } else { print "$text{'eacl_noicpr'}
\n"; print &ui_links_row([ &ui_link("icp_access.cgi?new=1", $text{'eacl_addicpr'}) ]); } print &ui_tabs_end_tab(); # List all HTTP REPLY restrictions, based on ACLs if ($squid_version >= 2.5) { print &ui_tabs_start_tab("mode", "reply"); my @http_reply = &find_config("http_reply_access", $conf); if (@http_reply) { my @tds = ( "width=5", "width=10%", undef, "width=32" ); print &ui_form_start("delete_http_reply_accesses.cgi", "post"); print &ui_links_row([ &ui_link("http_reply_access.cgi?new=1", $text{'eacl_addpr'}) ]); print &ui_columns_start([ "", $text{'eacl_act'}, $text{'eacl_acls1'}, $text{'eacl_move'} ], 100, 0, \@tds); my $hc = 0; foreach my $h (@http_reply) { my @v = @{$h->{'values'}}; if ($v[0] eq "allow") { $v[0] = $text{'eacl_allow'}; } else { $v[0] = $text{'eacl_deny'}; } my @cols; push(@cols, &ui_link("http_reply_access.cgi?index=$h->{'index'}", $v[0])); push(@cols, &html_escape(join(' ', @v[1..$#v]))); my $mover = &ui_up_down_arrows( "move_http_reply.cgi?$hc+-1", "move_http_reply.cgi?$hc+1", $hc != 0, $hc != @http_reply-1 ); push(@cols, $mover); print &ui_checked_columns_row(\@cols, \@tds, "d", $h->{'index'}); $hc++; } print &ui_columns_end(); print &ui_links_row([ &ui_link("http_reply_access.cgi?new=1", $text{'eacl_addpr'}) ]); print &ui_form_end([ [ "delete", $text{'eacl_hdelete'} ] ]); } else { print "$text{'eacl_noprr'}
\n"; print &ui_links_row([ &ui_link("http_reply_access.cgi?new=1", $text{'eacl_addpr'}) ]); } print &ui_tabs_end_tab(); } if ($squid_version >= 2.5) { # Show table of external ACL types print &ui_tabs_start_tab("mode", "external"); my @ext = &find_config("external_acl_type", $conf); if (@ext) { print &ui_links_row([ &ui_link("edit_ext.cgi?new=1", $text{'eacl_addext'}) ]); print &ui_columns_start([ $text{'eacl_cname'}, $text{'eacl_format'}, $text{'eacl_program'} ], 100); foreach my $e (@ext) { my $ea = &parse_external($e); print &ui_columns_row([ &ui_link("edit_ext.cgi?index=$e->{'index'}", $ea->{'name'}), $ea->{'format'}, join(" ", $ea->{'program'}, @{$ea->{'args'}}) ]); } print &ui_columns_end(); } else { print "$text{'eacl_noext'}
\n"; } print &ui_links_row([ &ui_link("edit_ext.cgi?new=1", $text{'eacl_addext'}) ]); print &ui_tabs_end_tab(); } print &ui_tabs_end(1); &ui_print_footer("", $text{'eacl_return'});