mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Merge branch 'master' of github.com:webmin/webmin
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1281,6 +1281,14 @@ elsif ($type eq "DMARC") {
|
||||
print &ui_table_row($text{'value_dmarcruf'},
|
||||
&ui_opt_textbox("dmarcruf", $ruf, 50, $text{'value_dmarcnor'}), 3);
|
||||
|
||||
print &ui_table_row($text{'value_dmarcrf'},
|
||||
&ui_select("dmarcrf", $dmarc->{'rf'},
|
||||
[ [ undef, $text{'default'} ],
|
||||
[ 'afrf', $text{'value_dmarcafrf'} ] ]));
|
||||
|
||||
print &ui_table_row($text{'value_dmarcri'},
|
||||
&ui_textbox("dmarcri", $dmarc->{'ri'}, 5)."s");
|
||||
|
||||
print &ui_table_row($text{'value_dmarcfo'},
|
||||
&ui_select("dmarcfo", $dmarc->{'fo'},
|
||||
[ [ undef, $text{'default'} ],
|
||||
|
||||
@@ -28,6 +28,6 @@ my $desc = &text('edit_header', &zone_subhead($zone));
|
||||
&ui_print_footer("", $text{'index_return'},
|
||||
"edit_$type.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'recs_return'},
|
||||
"edit_recs.cgi?zone=$in{'zone'}&type=$in{'type'}",
|
||||
"edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}",
|
||||
$text{'edit_return'});
|
||||
|
||||
|
||||
@@ -528,6 +528,9 @@ value_CAA3=CA domain name
|
||||
value_caa_issue=Single domain cert
|
||||
value_caa_issuewild=Wildcard cert
|
||||
value_caa_iodef=Policy violation URL
|
||||
+value_dmarcri=Reporting interval
|
||||
+value_dmarcrf=Report format
|
||||
+value_dmarcafrf=Authentication Failure Reporting Format
|
||||
|
||||
tlsa_usage0=Certificate authority
|
||||
tlsa_usage1=End entity
|
||||
|
||||
@@ -863,7 +863,7 @@ if ($txt =~ /^v=dmarc1/i) {
|
||||
my $dmarc = { };
|
||||
foreach my $w (@w) {
|
||||
$w = lc($w);
|
||||
if ($w =~ /^(v|pct|ruf|rua|p|sp|adkim|aspf|fo)=(\S+)$/i) {
|
||||
if ($w =~ /^(v|pct|ruf|rua|p|sp|adkim|aspf|fo|rf|ri)=(\S+)$/i) {
|
||||
$dmarc->{$1} = $2;
|
||||
}
|
||||
else {
|
||||
@@ -883,7 +883,7 @@ sub join_dmarc
|
||||
{
|
||||
my ($dmarc) = @_;
|
||||
my @rv = ( "v=DMARC1" );
|
||||
foreach my $s ("p", "pct", "ruf", "rua", "sp", "adkim", "aspf", "fo") {
|
||||
foreach my $s ("p", "pct", "ruf", "rua", "sp", "adkim", "aspf", "fo", "rf", "ri") {
|
||||
if ($dmarc->{$s} && $dmarc->{$s} ne '') {
|
||||
push(@rv, $s."=".$dmarc->{$s});
|
||||
}
|
||||
|
||||
@@ -422,6 +422,20 @@ else {
|
||||
$dmarc->{'fo'} = $in{'dmarcfo'};
|
||||
}
|
||||
|
||||
if ($in{'dmarcrf'} eq '') {
|
||||
delete($dmarc->{'rf'});
|
||||
}
|
||||
else {
|
||||
$dmarc->{'rf'} = $in{'dmarcrf'};
|
||||
}
|
||||
|
||||
if ($in{'dmarcri'} eq '') {
|
||||
delete($dmarc->{'ri'});
|
||||
}
|
||||
else {
|
||||
$dmarc->{'ri'} = $in{'dmarcri'};
|
||||
}
|
||||
|
||||
$vals = "\"".&join_dmarc($dmarc)."\"";
|
||||
}
|
||||
elsif ($in{'type'} eq 'NSEC3PARAM') {
|
||||
|
||||
@@ -15,6 +15,7 @@ Example code:
|
||||
##use warnings;
|
||||
use Socket;
|
||||
use POSIX;
|
||||
use feature 'state';
|
||||
eval "use Socket6";
|
||||
$ipv6_module_error = $@;
|
||||
our $error_handler_funcs = [ ];
|
||||
@@ -11970,6 +11971,92 @@ if (!$@) {
|
||||
}
|
||||
}
|
||||
|
||||
=head2 globals(action-type, variable-name, [[set-variable-value]|[set-scope-name]], [set-scope-name])
|
||||
|
||||
Provides access to handle global variables all in one place internally allowing to differentiate the scope if needed
|
||||
|
||||
Examples:
|
||||
|
||||
Set variable in default "main" scope
|
||||
- globals('set', 'var-1', 'val-1');
|
||||
|
||||
Get variable value previously set on default "main" scope
|
||||
- globals('get', 'var-1');
|
||||
|
||||
Delete variable in default "main" scope
|
||||
- globals('delete', 'var-1');
|
||||
|
||||
Set variable in given "virtual-server" scope
|
||||
- globals('set', 'var-1', 'val-1', 'virtual-server');
|
||||
|
||||
Get variable value previously set on given "virtual-server" scope
|
||||
- globals('get', 'var-1', 'virtual-server');
|
||||
|
||||
Delete variable in "main" scope
|
||||
- globals('delete', 'var-1');
|
||||
|
||||
Delete variable in given "virtual-server" scope
|
||||
- globals('delete', 'var-1', 'virtual-server');
|
||||
|
||||
Delete all variables in "main" scope
|
||||
- globals('delete', '*');
|
||||
|
||||
Delete all variables in given "virtual-server" scope
|
||||
- globals('delete', '*', 'virtual-server');
|
||||
|
||||
Delete all variables in all scopes
|
||||
- globals('delete');
|
||||
|
||||
=cut
|
||||
sub globals
|
||||
{
|
||||
my ($action, $variable, $value, $scope) = @_;
|
||||
state $globals;
|
||||
$scope = $value || 'main'
|
||||
if ($action =~ /get|delete/ && defined($variable) && defined($value) && !$scope);
|
||||
$scope ||= 'main';
|
||||
|
||||
if ($action eq 'set') {
|
||||
$globals->{$scope}->{$variable} = $value
|
||||
if (defined($variable) && defined($value));
|
||||
}
|
||||
elsif ($action eq 'get') {
|
||||
if (defined($variable)) {
|
||||
# Return single global variable in given scope
|
||||
if (defined($globals->{$scope}) &&
|
||||
defined($globals->{$scope}->{$variable})) {
|
||||
return $globals->{$scope}->{$variable};
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ($action eq 'delete') {
|
||||
if (defined($variable)) {
|
||||
if ($variable eq '*') {
|
||||
delete $globals->{$scope};
|
||||
}
|
||||
else {
|
||||
# Remove single global variable in scope
|
||||
delete $globals->{$scope}->{$variable};
|
||||
if (!keys %{$globals->{$scope}}) {
|
||||
delete $globals->{$scope};
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Delete all registered globals
|
||||
foreach (keys %{$globals}) {
|
||||
delete $globals->{$_};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Always return all registered globals
|
||||
return $globals;
|
||||
}
|
||||
|
||||
$done_web_lib_funcs = 1;
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user