Lines 21-28
use C4::Koha;
Link Here
|
21 |
use C4::Members; |
21 |
use C4::Members; |
22 |
use C4::Reserves; |
22 |
use C4::Reserves; |
23 |
use C4::Branch qw(GetBranchName); |
23 |
use C4::Branch qw(GetBranchName); |
24 |
use Digest::MD5 qw(md5_base64); |
|
|
25 |
use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio); |
24 |
use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio); |
|
|
25 |
use C4::Auth qw(checkpw_hash); |
26 |
|
26 |
|
27 |
our $VERSION = 3.07.00.049; |
27 |
our $VERSION = 3.07.00.049; |
28 |
|
28 |
|
Lines 40-46
sub new {
Link Here
|
40 |
} |
40 |
} |
41 |
$kp = GetMemberDetails($kp->{borrowernumber}); |
41 |
$kp = GetMemberDetails($kp->{borrowernumber}); |
42 |
$debug and warn "new Patron (GetMemberDetails): " . Dumper($kp); |
42 |
$debug and warn "new Patron (GetMemberDetails): " . Dumper($kp); |
43 |
my $pw = $kp->{password}; ### FIXME - md5hash -- deal with . |
43 |
my $pw = $kp->{password}; |
44 |
my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'"; |
44 |
my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'"; |
45 |
my $debarred = defined($kp->{flags}->{DBARRED}); |
45 |
my $debarred = defined($kp->{flags}->{DBARRED}); |
46 |
$debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}}); |
46 |
$debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}}); |
Lines 189-199
sub AUTOLOAD {
Link Here
|
189 |
|
189 |
|
190 |
sub check_password { |
190 |
sub check_password { |
191 |
my ($self, $pwd) = @_; |
191 |
my ($self, $pwd) = @_; |
192 |
my $md5pwd = $self->{password}; |
192 |
defined $pwd or return 0; # you gotta give me something (at least ''), or no deal |
|
|
193 |
|
194 |
my $hashed_pwd = $self->{password}; |
195 |
defined $hashed_pwd or return $pwd eq ''; # if the record has a NULL password, accept '' as match |
196 |
|
193 |
# warn sprintf "check_password for %s: '%s' vs. '%s'",($self->{name}||''),($self->{password}||''),($pwd||''); |
197 |
# warn sprintf "check_password for %s: '%s' vs. '%s'",($self->{name}||''),($self->{password}||''),($pwd||''); |
194 |
(defined $pwd ) or return 0; # you gotta give me something (at least ''), or no deal |
198 |
return checkpw_hash($pwd, $hashed_pwd); |
195 |
(defined $md5pwd) or return($pwd eq ''); # if the record has a NULL password, accept '' as match |
|
|
196 |
return (md5_base64($pwd) eq $md5pwd); |
197 |
} |
199 |
} |
198 |
|
200 |
|
199 |
# A few special cases, not in AUTOLOADed %fields |
201 |
# A few special cases, not in AUTOLOADed %fields |
200 |
- |
|
|