diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm index 64ea593ca..b1ee50ea5 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm @@ -54,8 +54,9 @@ sub load { $fields = $fields ? join( ",", @$fields ) : '*'; my $sth = $self->_dbh->prepare( - "SELECT field,value from " . $self->{dbiTable} . " WHERE cfgNum=?" ); - $sth->execute($cfgNum); + "SELECT field,value from " . $self->{dbiTable} . " WHERE cfgNum=?" ) + or $self->logError; + $sth->execute($cfgNum) or $self->logError; my ( $res, @row ); while ( @row = $sth->fetchrow_array ) { $res->{ $row[0] } = $row[1]; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm index ae7c3d00b..900f8c263 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm @@ -36,8 +36,8 @@ sub available { my $sth = $self->_dbh->prepare( "SELECT DISTINCT cfgNum from " . $self->{dbiTable} - . " order by cfgNum" ); - $sth->execute(); + . " order by cfgNum" ) or $self->logError; + $sth->execute() or $self->logError; my @conf; while ( my @row = $sth->fetchrow_array ) { push @conf, $row[0]; @@ -105,8 +105,9 @@ sub unlock { sub delete { my ( $self, $cfgNum ) = @_; my $req = - $self->_dbh->prepare("DELETE FROM $self->{dbiTable} WHERE cfgNum=?"); - my $res = $req->execute($cfgNum); + $self->_dbh->prepare("DELETE FROM $self->{dbiTable} WHERE cfgNum=?") + or $self->logError; + my $res = $req->execute($cfgNum) or $self->logError; $Lemonldap::NG::Common::Conf::msg .= "Unable to find conf $cfgNum (" . $self->_dbh->errstr . ")" unless ($res);