From 894c5935ea0e32cf374edfffb247757981b157d6 Mon Sep 17 00:00:00 2001 From: djfiander Date: Sun, 16 Apr 2006 15:47:29 +0000 Subject: [PATCH] Minor cleanups. --- ILS/Patron.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ILS/Patron.pm b/ILS/Patron.pm index 7b61cb6..c4d5de1 100644 --- a/ILS/Patron.pm +++ b/ILS/Patron.pm @@ -59,8 +59,8 @@ sub new { if (!exists($patron_db{$patron_id})) { return undef; } - $self = $patron_db{$patron_id}; + bless $self, $type; return $self; } @@ -167,10 +167,18 @@ sub items_billed { return $self->{items_billed}; } +sub password { + my $self = shift; + + return $self->{password}; +} + sub check_password { my ($self, $pwd) = @_; - return ($self->{password} eq $pwd); + # If the patron doesn't have a password, + # then we don't need to check + return (!$self->{password} || ($pwd && ($self->{password} eq $pwd))); } sub currency { -- 2.11.0