DBI: verify parameters during init (Fixes: #2161)

This commit is contained in:
Xavier Guimard 2020-04-21 07:55:01 +02:00
parent cd8f8bd847
commit faadd4fc52
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,10 @@ extends 'Lemonldap::NG::Portal::Auth::_WebForm',
sub init {
my ($self) = @_;
foreach (qw(dbiAuthTable dbiAuthLoginCol dbiAuthPasswordCol)) {
$self->logger->warn(
ref($self) . " seems not configured: missing $_" );
}
return ( $self->Lemonldap::NG::Portal::Auth::_WebForm::init
and $self->Lemonldap::NG::Portal::Lib::DBI::init );
}

View File

@ -75,6 +75,11 @@ sub init {
my ($self) = @_;
$self->_dbh
or $self->logger->error("DBI connection has failed, but let's continue");
unless ( $self->table ) {
$self->logger->error(
"SQL Table name is not set, can't load " . ref($self) );
return 0;
}
return 1;
}