X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/1c385c602908735c3be266b1470b301050650fd3..28d69bb85e934088a56e6e8458cd08d3794e1f8b:/SL/Auth/DB.pm diff --git a/SL/Auth/DB.pm b/SL/Auth/DB.pm index 66d23cd27..ab8788abd 100644 --- a/SL/Auth/DB.pm +++ b/SL/Auth/DB.pm @@ -25,6 +25,10 @@ sub new { return $self; } +sub reset { + # nothing to do here +} + sub authenticate { $main::lxdebug->enter_sub(); @@ -32,15 +36,7 @@ sub authenticate { my $login = shift; my $password = shift; - my $dbh = $self->{auth}->dbconnect(); - - if (!$dbh) { - $main::lxdebug->leave_sub(); - return ERR_BACKEND; - } - - my $query = qq|SELECT password FROM auth."user" WHERE login = ?|; - my ($stored_password) = $dbh->selectrow_array($query, undef, $login); + my $stored_password = $self->{auth}->get_stored_password($login); my ($algorithm, $algorithm2); @@ -78,7 +74,7 @@ sub change_password { return ERR_BACKEND; } - $password = SL::Auth::Password->hash(password => $password) unless $is_crypted; + $password = SL::Auth::Password->hash(login => $login, password => $password) unless $is_crypted; do_query($main::form, $dbh, qq|UPDATE auth."user" SET password = ? WHERE login = ?|, $password, $login);