Revision d3d6cb31
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
165 | 165 |
sub store_credentials_in_session { |
166 | 166 |
my ($self, %params) = @_; |
167 | 167 |
|
168 |
$params{password} = SL::Auth::Password->hash_if_unhashed(login => $params{login}, password => $params{password}) |
|
169 |
unless $self->{authenticator}->requires_cleartext_password; |
|
168 |
if (!$self->{authenticator}->requires_cleartext_password) { |
|
169 |
$params{password} = SL::Auth::Password->hash_if_unhashed(login => $params{login}, |
|
170 |
password => $params{password}, |
|
171 |
look_up_algorithm => 1, |
|
172 |
auth => $self); |
|
173 |
} |
|
170 | 174 |
|
171 | 175 |
$self->set_session_value(login => $params{login}, password => $params{password}); |
172 | 176 |
} |
... | ... | |
177 | 181 |
$self->set_session_value(rpw => SL::Auth::Password->hash_if_unhashed(login => 'root', password => $rpw)); |
178 | 182 |
} |
179 | 183 |
|
184 |
sub get_stored_password { |
|
185 |
my ($self, $login) = @_; |
|
186 |
|
|
187 |
my $dbh = $self->dbconnect; |
|
188 |
|
|
189 |
return undef unless $dbh; |
|
190 |
|
|
191 |
my $query = qq|SELECT password FROM auth."user" WHERE login = ?|; |
|
192 |
my ($stored_password) = $dbh->selectrow_array($query, undef, $login); |
|
193 |
|
|
194 |
return $stored_password; |
|
195 |
} |
|
196 |
|
|
180 | 197 |
sub dbconnect { |
181 | 198 |
$main::lxdebug->enter_sub(2); |
182 | 199 |
|
Auch abrufbar als: Unified diff
Fall 'kein Hash-Algorithmus angegeben' bei alten Passwörtern richtig behandeln