From 6f37ca1ddfcbea1ed519dcd19e323d8efe27fabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Mon, 4 Oct 2010 09:07:30 +0000 Subject: [PATCH] check authChoice in Manager globalTests --- .../lib/Lemonldap/NG/Manager/_Struct.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm index 787fef515..2451cd0b1 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm @@ -1846,7 +1846,7 @@ sub globalTests { # 2. MODIFICATIONS - # Remove unused and non-customize parameters + # Remove unused and non-customized parameters compactModules => sub { foreach my $k ( keys %$conf ) { @@ -1855,12 +1855,28 @@ sub globalTests { # Check federation modules foreach my $type (qw(CAS OpenID SAML)) { + + # Check authChoice values + my ( $authChoice, $userDBChoice ) = ( undef, undef ); + if ( $conf->{authentication} eq 'Choice' + and defined $conf->{authChoiceModules} ) + { + foreach ( keys %{ $conf->{authChoiceModules} } ) { + my ( $auth, $userDB, $passwordDB ) = + split( '|', $conf->{authChoiceModules}->{$_} ); + $authChoice = 1 if $auth =~ /$type/i; + $userDBChoice = 1 if $userDB =~ /$type/i; + } + } + if ( ( $k =~ /^$type/i and not( $conf->{"issuerDB${type}Activation"} ) and not( $conf->{authentication} =~ /$type/i ) and not( $conf->{userDB} =~ /$type/i ) + and not( defined $authChoice + or defined $userDBChoice ) ) ) {