X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth%2FDB.pm;h=0bbc050166466d7a419ab4dfbdf7368af544894e;hb=a4bd0c541580678d108c383ab268f233ce44b25b;hp=e70112be1d3e557236ca6a7e5a8359014ce5100c;hpb=58fdd50dbb6b909d48b2846f36857b2bd2219441;p=kivitendo-erp.git diff --git a/SL/Auth/DB.pm b/SL/Auth/DB.pm index e70112be1..0bbc05016 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); @@ -59,6 +55,10 @@ sub can_change_password { return 1; } +sub requires_cleartext_password { + return 0; +} + sub change_password { $main::lxdebug->enter_sub(); @@ -74,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);