\n";
print " $text{'esub_desc'} | \n";
printf " | \n",
$sub ? &html_escape($sub->{'comment'}) : "";
print " $text{'esub_naddr'} | \n";
printf " | \n",
$sub ? $sub->{'values'}->[0] : "";
print "$text{'esub_nmask'} | \n";
printf " | \n",
$sub ? $sub->{'values'}->[2] : "";
@range = $sub ? &find("range", $sub->{'members'}) : ();
print " $text{'esub_arange'} | \n";
for($i=0; $i<=@range; $i++) {
$r = $range[$i];
local $dyn = ($r->{'values'}->[0] eq "dynamic-bootp");
printf " - \n",
$r->{'values'}->[$dyn];
printf " \n",
$r->{'values'}->[$dyn+1];
printf "\n",
$dyn ? "checked" : "";
print "$text{'esub_dbooptpq'} \n";
}
print " | \n";
if (!defined($in{'ret'})) {
print " $text{'esub_shnet'} | \n";
print " | \n";
}
else {
print "{'index'}>\n";
print " | | \n";
}
&display_params($sconf, "subnet");
foreach $h (&find("host", $mems)) {
push(@host, $h);
# if &can('r', \%access, $h);
}
foreach $g (&find("group", $mems)) {
push(@group, $g);
# if &can('r', \%access, $g);
}
foreach $s (&find("subnet", $mems)) {
foreach $h (&find("host", $s->{'members'})) {
push(@host, $h);
# if &can('r', \%access, $h);
$insubn{$h} = $s->{'index'};
}
foreach $g (&find("group", $s->{'members'})) {
push(@group, $g);
# if &can('r', \%access, $g);
$insubn{$g} = $s->{'index'};
}
}
@host = sort { $a->{'values'}->[0] cmp $b->{'values'}->[0] } @host;
# @group = sort { @{$a->{'members'}} <=> @{$b->{'members'}} } @group;
print " $text{'esub_hosts'} | \n";
print " | \n";
print "$text{'esub_groups'} | \n";
print " | \n";
if (!$in{'new'}) {
# inaccessible hosts in this subnet
foreach $h (@host) {
if (!&can('r', \%access, $h) && $insubn{$h} eq $sub->{'index'}) {
print "{'index'},$sub->{'index'}\" type=hidden>\n";
}
}
# inaccessible groups in this subnet
foreach $g (@group) {
if (!&can('r', \%access, $g) && $insubn{$g} eq $sub->{'index'}) {
print "{'index'},$sub->{'index'}\" type=hidden>\n";
}
}
}
print " |