Avoid `die` when no conf is available

environments/ppa-mbqj77/deployments/1
Xavier Guimard 10 years ago
parent 961e273d43
commit 3868343e12
  1. 13
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Reload.pm
  2. 3
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
  3. 4
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm

@ -143,7 +143,11 @@ sub defaultValuesInit {
# @param $args reference to the configuration hash
sub portalInit {
my ( $class, $conf, $tsv ) = @_;
die("portal parameter required") unless ( $conf->{portal} );
unless ( $conf->{portal} ) {
Lemonldap::NG::Handler::Main::Logger->lmLog(
"portal parameter required", 'error' );
return 0;
}
if ( $conf->{portal} =~ /[\$\(&\|"']/ ) {
( $tsv->{portal} ) = $class->conditionSub( $conf->{portal}, $tsv );
}
@ -203,8 +207,11 @@ sub locationRulesInit {
# @param $args reference to the configuration hash
sub sessionStorageInit {
my ( $class, $conf, $tsv ) = @_;
$tsv->{sessionStorageModule} = $conf->{globalStorage}
or die("globalStorage required");
unless ( $tsv->{sessionStorageModule} = $conf->{globalStorage} ) {
Lemonldap::NG::Handler::Main::Logger->lmLog( "globalStorage required",
'error' );
return 0;
}
eval "use $tsv->{sessionStorageModule}";
die($@) if ($@);
$tsv->{sessionStorageOptions} = $conf->{globalStorageOptions};

@ -68,7 +68,8 @@ sub init {
target => &{ $Lemonldap::NG::Handler::SharedConf::tsv->{portal} }
. '?logout=1',
title => 'logout'
};
}
if ( defined $Lemonldap::NG::Handler::SharedConf::tsv->{portal} );
1;
}

@ -181,7 +181,7 @@ qr/^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9\/\+\r\n]+={0,2}(?:\r
'test' => sub {
my $test =
grep( { $_ eq $_[0]; }
map( { $_->{'k'}; } @{ $_[2]{'select'}; } ) );
map( { $$_{'k'}; } @{ $_[2]{'select'}; } ) );
return $test
? 1
: ( 0, "Invalid value '$_[0]' for this select" );
@ -998,7 +998,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
'default' => 'ldap://localhost',
'test' => sub {
my $l = shift();
my @s = split( /[\s,]+/, $l, 0 );
my (@s) = split( /[\s,]+/, $l, 0 );
foreach my $s (@s) {
return 0, qq[Bad ldap uri "$s"]
unless $s =~

Loading…
Cancel
Save