mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
warn/strict for acl_security.pl
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require 'bind8-lib.pl';
|
||||
# Globals from bind8-lib.pl
|
||||
our (%config, %text, %in);
|
||||
|
||||
# acl_security_form(&options)
|
||||
# Output HTML for editing security options for the bind8 module
|
||||
sub acl_security_form
|
||||
{
|
||||
local $m = $_[0]->{'zones'} eq '*' ? 1 :
|
||||
my $m = $_[0]->{'zones'} eq '*' ? 1 :
|
||||
$_[0]->{'zones'} =~ /^\!/ ? 2 : 0;
|
||||
print "<tr> <td valign=top><b>$text{'acl_zones'}</b></td>\n";
|
||||
print "<td colspan=3><table cellpadding=0 cellspacing=0> <tr><td valign=top>\n";
|
||||
@@ -17,24 +21,23 @@ printf "<input type=radio name=zones_def value=2 %s> %s</td>\n",
|
||||
$m == 2 ? 'checked' : '', $text{'acl_znsel'};
|
||||
|
||||
print "<td><select name=zones multiple size=4 width=150>\n";
|
||||
local $conf = &get_config();
|
||||
local @zones = grep { $_->{'value'} ne "." }
|
||||
my $conf = &get_config();
|
||||
my @zones = grep { $_->{'value'} ne "." }
|
||||
&find("zone", $conf);
|
||||
local @views = &find("view", $conf);
|
||||
local $v;
|
||||
foreach $v (@views) {
|
||||
my @views = &find("view", $conf);
|
||||
foreach my $v (@views) {
|
||||
push(@zones, grep { $_->{'value'} ne "." }
|
||||
&find("zone", $v->{'members'}));
|
||||
}
|
||||
local ($z, %zcan);
|
||||
my %zcan;
|
||||
map { $zcan{$_}++ } split(/\s+/, $_[0]->{'zones'});
|
||||
foreach $z (sort { $a->{'value'} cmp $b->{'value'} } @zones) {
|
||||
foreach my $z (sort { $a->{'value'} cmp $b->{'value'} } @zones) {
|
||||
printf "<option value='%s' %s>%s</option>\n",
|
||||
$z->{'value'},
|
||||
$zcan{$z->{'value'}} ? "selected" : "",
|
||||
&arpa_to_ip($z->{'value'});
|
||||
}
|
||||
foreach $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
|
||||
foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
|
||||
printf "<option value='%s' %s>%s</option>\n",
|
||||
'view_'.$v->{'value'},
|
||||
$zcan{'view_'.$v->{'value'}} ? "selected" : "",
|
||||
@@ -49,12 +52,12 @@ if (@views) {
|
||||
[ [ 1, $text{'acl_vall'} ],
|
||||
[ 0, $text{'acl_vsel'} ] ]),"<br>\n";
|
||||
print "<select name=inviews multiple size=4 width=150>\n";
|
||||
local ($v, %vcan);
|
||||
my %vcan;
|
||||
map { $vcan{$_}++ } split(/\s+/, $_[0]->{'inviews'});
|
||||
printf "<option value='%s' %s>%s</option>\n",
|
||||
"_", $vcan{"_"} ? "selected" : "",
|
||||
"<".$text{'acl_toplevel'}.">";
|
||||
foreach $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
|
||||
foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
|
||||
printf "<option value='%s' %s>%s</option>\n",
|
||||
$v->{'value'},
|
||||
$vcan{$v->{'value'}} ? "selected" : "", $v->{'value'};
|
||||
@@ -83,7 +86,7 @@ printf "<input type=radio name=defaults value=0 %s> $text{'no'}</td> </tr>\n",
|
||||
$_[0]->{'defaults'} ? "" : "checked";
|
||||
|
||||
print "<tr> <td><b>$text{'acl_ztypes'}</b></td> <td colspan=3>\n";
|
||||
foreach $t ("master", "slave", "forward", "delegation") {
|
||||
foreach my $t ("master", "slave", "forward", "delegation") {
|
||||
printf "<input type=checkbox name=%s %s> %s\n",
|
||||
$t, $_[0]->{$t} ? "checked" : "", $text{'acl_ztypes_'.$t};
|
||||
}
|
||||
@@ -185,7 +188,7 @@ printf "<input type=radio name=views value=0 %s> $text{'no'}</td> </tr>\n",
|
||||
$_[0]->{'views'} ? "" : "checked";
|
||||
|
||||
if (@views) {
|
||||
local $m = $_[0]->{'vlist'} eq '*' ? 1 :
|
||||
my $m = $_[0]->{'vlist'} eq '*' ? 1 :
|
||||
$_[0]->{'vlist'} =~ /^\!/ ? 2 :
|
||||
$_[0]->{'vlist'} eq '' ? 3 : 0;
|
||||
print "<tr> <td valign=top><b>$text{'acl_vlist'}</b></td>\n";
|
||||
@@ -200,9 +203,9 @@ if (@views) {
|
||||
$m == 3 ? 'checked' : '', $text{'acl_vnone'};
|
||||
|
||||
print "<td><select name=vlist multiple size=4 width=150>\n";
|
||||
local ($v, %vcan);
|
||||
my ($v, %vcan);
|
||||
map { $vcan{$_}++ } split(/\s+/, $_[0]->{'vlist'});
|
||||
foreach $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
|
||||
foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
|
||||
printf "<option value='%s' %s>%s</option>\n",
|
||||
$v->{'value'},
|
||||
$vcan{$v->{'value'}} ? "selected" : "", $v->{'value'};
|
||||
|
||||
Reference in New Issue
Block a user