From e1e86a44afea0899b9c2a6d4bc5f2cf6d74a330e Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Tue, 9 Feb 2021 22:37:45 +0100 Subject: [PATCH] Improve conf test (#2329) --- .../lib/Lemonldap/NG/Manager/Conf/Tests.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm index 817425fb9..61fbf6114 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm @@ -944,6 +944,19 @@ sub tests { return ( -1, 'Password module is enabled without password backend' ) if ( $conf->{portalDisplayChangePassword} and $conf->{passwordDB} eq 'Null' ); + if ( $conf->{portalDisplayChangePassword} + and $conf->{passwordDB} eq 'Choice' + and $conf->{authChoiceModules} ) + { + my $hasPwdBE = 0; + foreach ( keys %{ $conf->{authChoiceModules} } ) { + my @mods = split /[;\|]/, $conf->{authChoiceModules}->{$_}; + $hasPwdBE ||= 1 unless $mods[2] eq 'Null'; + } + return ( -1, + 'Password module is enabled without AuthChoice password backend' ) + unless $hasPwdBE; + } return 1; },