Closes #181
This commit is contained in:
parent
84a56ef1d8
commit
f570afbad1
@ -338,7 +338,7 @@ s/^(samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions)\/(
|
|||||||
} # END LOOP
|
} # END LOOP
|
||||||
|
|
||||||
# 1.4 Loading unchanged parameters (ajax nodes not open)
|
# 1.4 Loading unchanged parameters (ajax nodes not open)
|
||||||
$self->lmLog( "Save unchanged parameters", 'debug' );
|
$self->lmLog( "Restore unchanged parameters", 'debug' );
|
||||||
foreach ( @{ $result->getChildrenByTagName('ignore') } ) {
|
foreach ( @{ $result->getChildrenByTagName('ignore') } ) {
|
||||||
my $node = $_->getAttribute('value');
|
my $node = $_->getAttribute('value');
|
||||||
$node =~ s/^.*node=(.*?)(?:&.*)?\}$/$1/;
|
$node =~ s/^.*node=(.*?)(?:&.*)?\}$/$1/;
|
||||||
@ -356,7 +356,28 @@ s/^(samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions)\/(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 1.5 Author attributes for accounting
|
# 1.5 Global tests
|
||||||
|
$self->lmLog( "Launch global tests", 'debug' );
|
||||||
|
{
|
||||||
|
my $tests = $self->globalTests($newConf);
|
||||||
|
while ( my ( $name, $sub ) = each %$tests ) {
|
||||||
|
my ( $res, $msg );
|
||||||
|
eval {
|
||||||
|
( $res, $msg ) = $sub->();
|
||||||
|
if ($res) {
|
||||||
|
if ($msg) {
|
||||||
|
$errors->{warnings}->{$name} = $msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors->{error}->{$name} = $msg;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$errors->{warnings}->{$name} = "Test $name failed" if($@);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1.6 Author attributes for accounting
|
||||||
$newConf->{cfgAuthor} = $ENV{REMOTE_USER} || 'anonymous';
|
$newConf->{cfgAuthor} = $ENV{REMOTE_USER} || 'anonymous';
|
||||||
$newConf->{cfgAuthorIP} = $ENV{REMOTE_ADDR};
|
$newConf->{cfgAuthorIP} = $ENV{REMOTE_ADDR};
|
||||||
$newConf->{cfgDate} = time();
|
$newConf->{cfgDate} = time();
|
||||||
|
@ -1782,4 +1782,27 @@ sub subDefaultConf {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## @method hashref globalTests(hashref conf)
|
||||||
|
# Return a hash ref where keys are the names of the tests and values
|
||||||
|
# subroutines to execute
|
||||||
|
# @param $conf Configuration to test
|
||||||
|
# @return hash ref where keys are the names of the tests and values
|
||||||
|
sub globalTests {
|
||||||
|
my ( $self, $conf ) = splice @_;
|
||||||
|
return {
|
||||||
|
'portalIsInDomain' => sub {
|
||||||
|
|
||||||
|
# TODO: better parsing
|
||||||
|
return (
|
||||||
|
1,
|
||||||
|
(
|
||||||
|
index( $conf->{portal}, $conf->{domain} ) > 0
|
||||||
|
? ''
|
||||||
|
: "Portal seems not to be in the domain $conf->{domain}"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user