Add test for combination (#1151)
This commit is contained in:
parent
313e016cd0
commit
cd894cbc2c
|
@ -19,6 +19,11 @@
|
||||||
* Add test for #173
|
* Add test for #173
|
||||||
* lwpSslOpt
|
* lwpSslOpt
|
||||||
|
|
||||||
|
# Combination
|
||||||
|
|
||||||
|
* getDisplayType()
|
||||||
|
* detect changes
|
||||||
|
|
||||||
# Password
|
# Password
|
||||||
|
|
||||||
* Enable it during auth
|
* Enable it during auth
|
||||||
|
|
|
@ -275,6 +275,27 @@ sub tests {
|
||||||
# Return
|
# Return
|
||||||
return 1;
|
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 {
|
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
|
# TODO: authLogout
|
||||||
|
|
|
@ -251,7 +251,7 @@ sub display {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Display authentifcation form
|
# Display authentication form
|
||||||
else {
|
else {
|
||||||
|
|
||||||
# Authentication loop
|
# Authentication loop
|
||||||
|
|
Loading…
Reference in New Issue
Block a user