\n";
$mode = $type eq 'local' ? 3 :
$host->{'cidr'} ne '' ? 4 :
$host->{'netmask'} eq '0.0.0.0' ? 0 :
$host->{'netmask'} eq '255.255.255.255' ? 1 : 2;
print " | $text{'host_address'} | \n";
printf " %s \n",
$mode == 3 ? 'checked' : '', $text{'host_local'};
printf " %s \n",
$mode == 0 ? 'checked' : '', $text{'host_any'};
printf " %s\n",
$mode == 1 ? 'checked' : '', $text{'host_single'};
printf " \n",
$mode == 1 ? $host->{'address'} : '';
printf " %s\n",
$mode == 2 ? 'checked' : '', $text{'host_network'};
printf " %s\n",
$mode == 2 ? $host->{'address'} : '', $text{'host_netmask'};
printf " \n",
$mode == 2 ? $host->{'netmask'} : '';
printf " %s\n",
$mode == 4 ? 'checked' : '', $text{'host_network'};
printf " %s\n",
$mode == 4 ? $host->{'address'} : '', $text{'host_cidr'};
printf " | \n",
$mode == 4 ? $host->{'cidr'} : '';
if ($type eq "hostssl" || $v >= 7.3) {
print " | \n";
printf " %s | \n",
$typeq eq "hostssl" ? "checked" : "", $text{'host_ssl'};
}
local $found = !$host->{'db'} || $host->{'db'} eq 'all' ||
$host->{'db'} eq 'sameuser';
print " | $text{'host_db'} | \n";
print "\n";
printf " | \n",
$found ? "" : join(" ", split(/,/, $host->{'db'}));
if ($v >= 7.3) {
print " | $text{'host_user'} | \n";
printf " %s\n",
$host->{'user'} eq 'all' || !$host->{'user'} ? "checked" : "",
$text{'host_uall'};
printf " %s\n",
$host->{'user'} eq 'all' || !$host->{'user'} ? "" : "checked",
$text{'host_usel'};
printf " | \n",
$host->{'user'} eq 'all' ? ""
: join(" ", split(/,/, $host->{'user'}));
}
print " | $text{'host_auth'} | \n";
foreach $a ('password', 'crypt', ($v >= 7.2 ? ( 'md5' ) : ( )),
'trust', 'reject', 'ident', 'krb4', 'krb5',
($v >= 7.3 ? ( 'pam' ) : ( )) ) {
printf " %s\n",
$a, $host->{'auth'} eq $a ? 'checked' : '', $text{"host_$a"};
$arg = $host->{'auth'} eq $a ? $host->{'arg'} : undef;
if ($a eq 'password') {
print " \n";
printf " %s\n",
$arg ? 'checked' : '', $text{'host_passwordarg'};
print "\n";
}
elsif ($a eq 'ident') {
print " \n";
printf " %s\n",
$arg ? 'checked' : '', $text{'host_identarg'};
print "\n";
}
elsif ($a eq 'pam') {
print " \n";
printf " %s\n",
$arg ? 'checked' : '', $text{'host_pamarg'};
print "\n";
}
print " \n";
if ($a eq 'reject') {
print " | \n";
}
}
print " | \n";
print " |