mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Show number of rule users
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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'} ],
|
||||
|
||||
Reference in New Issue
Block a user