DBI: verify parameters during init (Fixes: #2161)
This commit is contained in:
parent
cd8f8bd847
commit
faadd4fc52
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user