|
Lines 14-19
use Carp;
Link Here
|
| 14 |
|
14 |
|
| 15 |
use Sys::Syslog qw(syslog); |
15 |
use Sys::Syslog qw(syslog); |
| 16 |
use Data::Dumper; |
16 |
use Data::Dumper; |
|
|
17 |
use Time::Out qw(timeout); |
| 17 |
|
18 |
|
| 18 |
use C4::Debug; |
19 |
use C4::Debug; |
| 19 |
use C4::Context; |
20 |
use C4::Context; |
|
Lines 199-207
sub check_password {
Link Here
|
| 199 |
# If the record has a NULL password, accept '' as match |
200 |
# If the record has a NULL password, accept '' as match |
| 200 |
return $pwd eq q{} unless $self->{password}; |
201 |
return $pwd eq q{} unless $self->{password}; |
| 201 |
|
202 |
|
| 202 |
my $dbh = C4::Context->dbh; |
|
|
| 203 |
my $ret = 0; |
203 |
my $ret = 0; |
| 204 |
($ret) = checkpw( $dbh, $self->{userid}, $pwd, undef, undef, 1 ); # dbh, userid, query, type, no_set_userenv |
204 |
local $@; |
|
|
205 |
($ret) = timeout (5 => sub { |
| 206 |
# dbh, userid, query, type, no_set_userenv |
| 207 |
checkpw( C4::Context->dbh, $self->{userid}, $pwd, undef, undef, 1 ); |
| 208 |
}); |
| 209 |
if ($@) { |
| 210 |
($ret) = checkpw( C4::Context->new_dbh, $self->{userid}, $pwd, undef, undef, 1 ); |
| 211 |
} |
| 205 |
return $ret; |
212 |
return $ret; |
| 206 |
} |
213 |
} |
| 207 |
|
214 |
|