diff --git a/squid/http_access.cgi b/squid/http_access.cgi index fabfa2548..9f1690b89 100755 --- a/squid/http_access.cgi +++ b/squid/http_access.cgi @@ -10,6 +10,16 @@ $access{'actrl'} || &error($text{'eacl_ecannot'}); &ReadParse(); my $conf = &get_config(); +# Count up ACL users +my %ucount; +foreach my $h (&find_config("http_access", $conf)) { + foreach my $v (@{$h->{'values'}}) { + my $vv = $v; + $vv =~ s/^\!//; + $ucount{$vv}++; + } + } + my @http; if (!defined($in{'index'})) { &ui_print_header(undef, $text{'ahttp_header'}, "", @@ -50,11 +60,15 @@ my $r = @acls; $r = 10 if ($r > 10); print &ui_table_row($text{'ahttp_ma'}, - &ui_select("yes", \@yes, [ map { $_->{'values'}->[0] } @acls ], + &ui_select("yes", \@yes, [ map { my $v = $_->{'values'}->[0]; + [ $v, $v." (".int($ucount{$v}).")" ] } + @acls ], $r, 1, 1)); print &ui_table_row($text{'ahttp_dma'}, - &ui_select("no", \@no, [ map { $_->{'values'}->[0] } @acls ], + &ui_select("no", \@no, [ map { my $v = $_->{'values'}->[0]; + [ $v, $v." (".int($ucount{$v}).")" ] } + @acls ], $r, 1, 1)); print &ui_table_end(); diff --git a/squid/icp_access.cgi b/squid/icp_access.cgi index 8f3fb16c3..d6dfcbe11 100755 --- a/squid/icp_access.cgi +++ b/squid/icp_access.cgi @@ -10,6 +10,16 @@ $access{'actrl'} || &error($text{'eacl_ecannot'}); &ReadParse(); my $conf = &get_config(); +# Count up ACL users +my %ucount; +foreach my $h (&find_config("icp_access", $conf)) { + foreach my $v (@{$h->{'values'}}) { + my $vv = $v; + $vv =~ s/^\!//; + $ucount{$vv}++; + } + } + my @icp; if (!defined($in{'index'})) { &ui_print_header(undef, $text{'aicp_header'}, "", @@ -49,13 +59,13 @@ unshift(@acls, { 'values' => [ 'all' ] }) if ($squid_version >= 3); my $r = @acls; $r = 10 if ($r > 10); +my @opts = map { my $v = $_->{'values'}->[0]; + [ $v, $v." (".int($ucount{$v}).")" ] } @acls; print &ui_table_row($text{'aicp_ma'}, - &ui_select("yes", \@yes, [ map { $_->{'values'}->[0] } @acls ], - $r, 1, 1)); + &ui_select("yes", \@yes, \@opts, $r, 1, 1)); print &ui_table_row($text{'aicp_dma'}, - &ui_select("no", \@no, [ map { $_->{'values'}->[0] } @acls ], - $r, 1, 1)); + &ui_select("no", \@no, \@opts, $r, 1, 1)); print &ui_table_end(); print &ui_form_end([ [ undef, $text{'buttsave'} ],