3 # A form for editing or creating delay pool ACL
5 require './squid-lib.pl';
6 $access{'delay'} || &error($text{'delay_ecannot'});
10 if (!defined($in{'index'})) {
11 &ui_print_header(undef, $text{'apool_header'}, "",
12 undef, 0, 0, 0, &restart_button());
15 &ui_print_header(undef, $text{'apool_header1'}, "",
16 undef, 0, 0, 0, &restart_button());
17 @delay = @{$conf->[$in{'index'}]->{'values'}};
20 print "<form action=pool_access_save.cgi>\n";
22 print "<input type=hidden name=index value=$in{'index'}>\n";
24 print "<input type=hidden name=idx value=$in{'idx'}>\n";
25 print "<table border>\n";
26 print "<tr $tb> <td><b>$text{'apool_pr'}</b></td> </tr>\n";
27 print "<tr $cb> <td><table>\n";
29 print "<tr> <td><b>$text{'ahttp_a'}</b></td> <td colspan=3>\n";
30 printf "<input type=radio name=action value=allow %s> $text{'ahttp_a1'}\n",
31 $delay[1] eq "allow" ? "checked" : "";
32 printf "<input type=radio name=action value=deny %s> $text{'ahttp_d'}</td> </tr>\n",
33 $delay[1] eq "allow" ? "" : "checked";
35 for($i=2; $i<@delay; $i++) { $match{$delay[$i]}++; }
36 @acls = grep { !$done{$_->{'values'}->[0]}++ } &find_config("acl", $conf);
37 unshift(@acls, { 'values' => [ 'all' ] }) if ($squid_version >= 3);
38 $r = @acls; $r = 10 if ($r > 10);
40 print "<tr> <td valign=top><b>$text{'ahttp_ma'}</b></td>\n";
41 print "<td valign=top><select name=yes multiple size=$r width=100>\n";
43 printf "<option %s>%s\n",
44 $match{$a->{'values'}->[0]} ? "selected" : "",
47 print "</select></td>\n";
49 print "<td valign=top><b>$text{'ahttp_dma'}</b></td>\n";
50 print "<td valign=top><select name=no multiple size=$r width=100>\n";
52 printf "<option %s>%s\n",
53 $match{"!$a->{'values'}->[0]"} ? "selected" : "",
56 print "</select></td> </tr>\n";
58 print "</table></td></tr></table>\n";
59 print "<input type=submit value='$text{'buttsave'}'>\n";
61 print "<input type=submit value='$text{'buttdel'}' name=delete>\n";
65 &ui_print_footer("edit_pool.cgi?idx=$in{'idx'}", $text{'pool_return'},
66 "", $text{'index_return'});