Manager and CLI can now start with an empty configuration (#LEMONDAP-702)

environments/ppa-mbqj77/deployments/1
Clément Oudot 11 years ago
parent f14fa43167
commit a42f455ccc
  1. 3
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm
  2. 7
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Attributes.pm
  3. 6
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
  4. 15
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Uploader.pm

@ -357,7 +357,8 @@ sub available {
# Call lastCfg() from the $self->{type} package.
# @return Number of the last configuration available
sub lastCfg {
return &{ $_[0]->{type} . '::lastCfg' }(@_);
my $result = &{ $_[0]->{type} . '::lastCfg' }(@_) || "0";
return $result;
}
## @method boolean lock()

@ -125,6 +125,13 @@ has 'cda' => (
documentation => 'Enable Cross Domain Authentication',
);
has 'cfgNum' => (
is => 'rw',
isa => 'Int',
default => '0',
documentation => 'Configuration number',
);
has 'checkXSS' => (
is => 'rw',
isa => 'Bool',

@ -104,10 +104,8 @@ sub new {
# Else load conf
require Lemonldap::NG::Manager::Downloader; #inherits
$self->{cfgNum} =
$self->param('cfgNum')
|| $self->confObj->lastCfg()
|| 'UNAVAILABLE';
$self->{cfgNum} = $self->param('cfgNum')
|| $self->confObj->lastCfg();
if ( my $p = $self->param('node') ) {

@ -52,11 +52,10 @@ sub confUpload {
->documentElement();
# 1.2 Get configuration number
unless ( $self->{cfgNum} =
$result->getChildrenByTagName('conf')->[0]->getAttribute('value') )
{
die "No configuration number found";
}
$self->{cfgNum} =
$result->getChildrenByTagName('conf')->[0]->getAttribute('value');
die "No configuration number found" unless defined $self->{cfgNum};
my $newConf = { cfgNum => $self->{cfgNum} };
my $errors = {};
@ -332,7 +331,11 @@ s/^(samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions)\/(
$self->setKeyToH(
$newConf, $confKey,
$test->{keyTest}
? ( ( $id !~ /\// or $test->{'*'} ) ? {} : ( $name => $value ) )
? (
( $id !~ /\// or $test->{'*'} )
? {}
: ( $name => $value )
)
: $value
);
}

Loading…
Cancel
Save