Fix use of check_password in DBI backend (#655)

This commit is contained in:
Clément Oudot 2013-12-09 17:03:50 +00:00
parent 7cdc09a9cf
commit 8ed6bdfdeb
2 changed files with 7 additions and 6 deletions

View File

@ -12,7 +12,7 @@ use base qw(Lemonldap::NG::Portal::_DBI );
#inherits Lemonldap::NG::Portal::_SMTP
our $VERSION = '1.2.2';
our $VERSION = '1.3.2';
## @apmethod int passwordDBInit()
# Load SMTP functions and call DBI authInit()
@ -64,7 +64,7 @@ sub modifyPassword {
# Check old password
if ( $self->{oldpassword} ) {
my $result = $self->check_password( $user, $self->{oldpassword} );
my $result = $self->check_password( $dbh, $user, $self->{oldpassword} );
unless ($result) {
return PE_BADOLDPASSWORD;

View File

@ -12,7 +12,7 @@ use strict;
our @EXPORT = qw(dbh);
our $VERSION = '1.2.3';
our $VERSION = '1.3.2';
## @method protected Lemonldap::NG::Portal::_DBI dbh(string dbiChain, string dbiUser, string dbiPassword)
# Create connection to database
@ -65,16 +65,17 @@ sub hash_password {
}
## @method protected Lemonldap::NG::Portal::_DBI check_password(string user, string password)
## @method protected Lemonldap::NG::Portal::_DBI check_password(ref dbh, string user, string password)
# Verify user and password with SQL SELECT
# @param dbh database handle
# @param user user
# @param password password
# @return boolean result
sub check_password {
my $self = shift;
my $dbh = shift;
my $user = $self->{user};
my $password = $self->{password};
my $user = shift || $self->{user};
my $password = shift || $self->{password};
my $table = $self->{dbiAuthTable};
my $loginCol = $self->{dbiAuthLoginCol};
my $passwordCol = $self->{dbiAuthPasswordCol};