X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth%2FDB.pm;h=ab8788abda9cf7c4f8b255cd8e49bfb68ecb148e;hb=496f2f9f8574affb940c5b83deb837860a3b112a;hp=66d23cd278646742bf88dda89b87ee1f6896b7f7;hpb=1c385c602908735c3be266b1470b301050650fd3;p=kivitendo-erp.git 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);