auth module may contains parameters

This commit is contained in:
Xavier Guimard 2013-10-05 15:59:18 +00:00
parent 1c35cedc0a
commit be083d33e3
4 changed files with 6 additions and 8 deletions

View File

@ -16,7 +16,7 @@ our $VERSION = '1.3.0';
sub userDBInit { sub userDBInit {
my $self = shift; my $self = shift;
if ( $self->get_module('auth') eq 'Demo' ) { if ( $self->get_module('auth') =~ /^Demo/ ) {
# Call authInit if demo accounts not found # Call authInit if demo accounts not found
$self->authInit() unless defined $self->{_demoAccounts}; $self->authInit() unless defined $self->{_demoAccounts};

View File

@ -17,15 +17,14 @@ our $VERSION = '1.3.0';
sub userDBInit { sub userDBInit {
my $self = shift; my $self = shift;
if ( $self->get_module('auth') eq 'Google' ) { unless ( $self->get_module('auth') =~ /^Google/ ) {
}
else {
$self->lmLog( $self->lmLog(
'UserDBGoogle isn\'t useable unless authentication module is set to Google', 'UserDBGoogle isn\'t useable unless authentication module is set to Google',
'error' 'error'
); );
return PE_ERROR; return PE_ERROR;
} }
PE_OK;
} }
## @apmethod int getUser() ## @apmethod int getUser()

View File

@ -17,15 +17,14 @@ our $VERSION = '1.0.0';
sub userDBInit { sub userDBInit {
my $self = shift; my $self = shift;
if ( $self->get_module('auth') eq 'OpenID' ) { unless ( $self->get_module('auth') =~ /^OpenID/ ) {
}
else {
$self->lmLog( $self->lmLog(
'UserDBOpenID isn\'t useable unless authentication module is set to OpenID', 'UserDBOpenID isn\'t useable unless authentication module is set to OpenID',
'error' 'error'
); );
return PE_ERROR; return PE_ERROR;
} }
PE_OK;
} }
## @apmethod int getUser() ## @apmethod int getUser()

View File

@ -18,7 +18,7 @@ our $VERSION = '1.0.0';
# @return Lemonldap::NG::Portal error code # @return Lemonldap::NG::Portal error code
sub userDBInit { sub userDBInit {
my $self = shift; my $self = shift;
if ( $self->get_module('auth') eq 'SAML' ) { if ( $self->get_module('auth') =~ /^SAML/ ) {
return PE_OK; return PE_OK;
} }
else { else {