Allow cidr maps and multiple SMTP client maps

This commit is contained in:
Jamie Cameron
2010-03-29 13:55:22 -07:00
parent e2a98b192a
commit db57c2dbea
3 changed files with 14 additions and 7 deletions

View File

@@ -73,3 +73,5 @@ t/html MIME type.
---- Changes since 1.500 ----
If a map is made up of files in multiple directories and a Webmin user has a directory restriction defined, he will be able to edit map entries in files under that directory.
Fixed the descriptions of logged events as shown in the Webmin Actions Log module.
---- Changes since 1.510 ----
Added support for CIDR maps and multiple SMTP client restriction maps.

View File

@@ -39,7 +39,7 @@ foreach $r (&list_multi_client_restrictions()) {
}
push(@grid, &ui_checkbox("client", $r, $text{'sasl_'.$r},
scalar(@v)),
&ui_textbox("value_$r", $vals, 40).
&ui_textbox("value_$r", $vals, 60).
($r eq "check_client_access" ?
" ".&map_chooser_button("value_$r", $r) : ""));
$done{$r} = 1;

View File

@@ -152,11 +152,16 @@ if (!defined($out)) {
chop($out);
}
if ($key) {
my @res=();
foreach (split /,/,$out)
{ push @res, $1 if /$key\s+(.+)/; }
if ($#res>0) {$out=join ", ",@res}
else {$out=$res[0]}
# If the value asked for was like foo:bar, extract from the value
# the parts after bar
my @res = ( );
while($out =~ /^(.*?)\Q$key\E\s+(\S+)(.*)$/) {
my $v = $2;
$out = $3;
$v =~ s/,$//;
push(@res, $v);
}
return join(" ", @res);
}
return $out;
}
@@ -2172,7 +2177,7 @@ sub file_map_type
{
local ($type) = @_;
return 1 if ($type eq 'hash' || $type eq 'regexp' || $type eq 'pcre' ||
$type eq 'btree' || $type eq 'dbm');
$type eq 'btree' || $type eq 'dbm' || $type eq 'cidr');
}
# in_props(&props, name)