Commit cd894cbc authored by Xavier Guimard's avatar Xavier Guimard

Add test for combination (#1151)

parent 313e016c
......@@ -19,6 +19,11 @@
* Add test for #173
* lwpSslOpt
# Combination
* getDisplayType()
* detect changes
# Password
* Enable it during auth
......
......@@ -275,6 +275,27 @@ sub tests {
# Return
return 1;
},
checkCombinations => sub {
return 1 unless ( $conf->{authentication} eq 'Combination' );
require Lemonldap::NG::Common::Combination::Parser;
return ( 0, 'No module declared for combination' )
unless ( $conf->{combModules} and %{ $conf->{combModules} } );
my $moduleList;
foreach my $md ( keys %{ $conf->{combModules} } ) {
my $entry = $conf->{combModules}->{$md};
$moduleList->{$md} = (
$entry->{for} == 2 ? [ undef, {} ]
: $entry->{for} == 1 ? [ {}, undef ]
: [ {}, {} ]
);
}
eval {
Lemonldap::NG::Common::Combination::Parser->parse( $moduleList,
$conf->{combination} );
};
return ( 0, $@ ) if ($@);
return 1;
},
};
}
......
......@@ -111,7 +111,10 @@ sub setGroups {
}
sub getDisplayType {
return $_[0]->try( 0, 'getDisplayType', {} );
my ( $self, $req ) = @_;
my ( $nb, $stack ) = ( $req->datas->{multiTry}, $req->datas->{multiStack} );
my ( $res, $name ) = $stack->[$nb]->[0]->( 'getDisplayType', $req );
return $res;
}
# TODO: authLogout
......
......@@ -251,7 +251,7 @@ sub display {
}
# Display authentifcation form
# Display authentication form
else {
# Authentication loop
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment