\n";
print " $text{'esh_desc'} | \n";
printf " | \n",
$sha ? &html_escape($sha->{'comment'}) : "";
print " $text{'esh_netname'} | \n";
printf " | \n",
$sha ? $sha->{'values'}->[0] : "";
&display_params($sconf, "shared-network");
print " \n";
foreach $h (&find("host", $conf)) {
push(@host, $h) if &can('r', \%access, $h);
}
foreach $g (&find("group", $conf)) {
push(@group, $g) if &can('r', \%access, $g);
}
foreach $s (&find("subnet", $conf)) {
push(@subn, $s) if &can('r', \%access, $s);
}
foreach $sh (&find("shared-network", $conf)) {
foreach $h (&find("host", $sh->{'members'})) {
push(@host, $h);
# if &can('r', \%access, $h);
$inshar{$h} = $sh->{'index'};
}
foreach $g (&find("group", $sh->{'members'})) {
push(@group, $g);
# if &can('r', \%access, $g);
$inshar{$g} = $sh->{'index'};
}
foreach $s (&find("subnet", $sh->{'members'})) {
push(@subn, $s);
# if &can('r', \%access, $s);
$inshar{$s} = $sh->{'index'};
}
}
@host = sort { $a->{'values'}->[0] cmp $b->{'values'}->[0] } @host;
# @group = sort { @{$a->{'members'}} <=> @{$b->{'members'}} } @group;
@subn = sort { $a->{'values'}->[0] cmp $b->{'values'}->[0] } @subn;
print "$text{'esh_hosts'} | \n";
print " | \n";
print "$text{'esh_groups'} | \n";
print " | \n";
print "$text{'esh_subn'} | \n";
print " | \n";
if (!$in{'new'}) {
# inaccessible hosts in this shared network
foreach $h (@host) {
if (!&can('r', \%access, $h) && $inshar{$h} eq $sha->{'index'}) {
print "{'index'},$sha->{'index'}\" type=hidden>\n";
}
}
# inaccessible groups in this shared network
foreach $g (@group) {
if (!&can('r', \%access, $g) && $inshar{$g} eq $sha->{'index'}) {
print "{'index'},$sha->{'index'}\" type=hidden>\n";
}
}
# inaccessible subnets in this shared network
foreach $s (@subn) {
if (!&can('r', \%access, $s) && $inshar{$s} eq $sha->{'index'}) {
print "{'index'},$sha->{'index'}\" type=hidden>\n";
}
}
}
print " | \n";
print " |