Bad usage of getModule (#595)

This commit is contained in:
Xavier Guimard 2017-01-30 21:35:37 +00:00
parent 3db4967853
commit f6665c2d41
6 changed files with 1 additions and 38 deletions

View File

@ -10,13 +10,7 @@ our $VERSION = '2.0.0';
sub init {
my ($self) = @_;
if ( $self->p->getModule( undef, 'auth' ) eq 'Demo' ) {
return $self->SUPER::init;
}
else {
$self->lmLog( "Use PasswordDBDemo only with AuthDemo", 'error' );
return 0;
}
return $self->SUPER::init;
}
sub confirm {

View File

@ -41,12 +41,6 @@ has demoAccounts => (
# Check AuthDemo use
sub init {
my $self = shift;
unless ( $self->p->getModule( undef, 'auth' ) =~ /Demo/ ) {
$self->p->error("Use UserDB::Demo only with Auth::Demo");
}
1;
}

View File

@ -21,13 +21,6 @@ has vars => (
# INITIALIZATION
sub init {
my ($self) = @_;
unless ( $self->p->getModule( undef, 'auth' ) =~ /^Facebook/ ) {
$self->error(
"UserDB::Facebook isn't useable unless authentication module is set to Facebook"
);
return 0;
}
return 1;
}

View File

@ -16,12 +16,6 @@ extends 'Lemonldap::NG::Common::Module',
sub init {
my ($self) = @_;
unless ( $self->p->getModule( undef, 'auth' ) =~ /^OpenID\b/ ) {
$self->error(
'UserDBOpenID isn\'t useable unless authentication module is set to OpenID'
);
return 0;
}
return 1;
}

View File

@ -19,11 +19,6 @@ extends 'Lemonldap::NG::Common::Module', 'Lemonldap::NG::Portal::Lib::SAML';
sub init {
my ($self) = @_;
unless ( $self->p->getModule( undef, 'auth' ) =~ /^SAML/ ) {
$self->error( "SAML user module requires SAML authentication" );
return 0;
}
# SAML service has been already loaded
$self->lassoServer(
$self->p->loadedModules->{'Lemonldap::NG::Portal::Auth::SAML'}

View File

@ -15,13 +15,6 @@ our $VERSION = '2.0.0';
# INITIALIZATION
sub init {
my $self = shift;
unless ( $self->p->getModule( undef, 'auth' ) =~ /^WebID/ ) {
$self->error(
"UserDB::WebID isn't useable unless authentication module is set to WebID"
);
return 0;
}
1;
}