Lines 268-289
sub store {
Link Here
|
268 |
if C4::Context->preference("BorrowersLog"); |
268 |
if C4::Context->preference("BorrowersLog"); |
269 |
} |
269 |
} |
270 |
else { #ModMember |
270 |
else { #ModMember |
271 |
# We could add a test here to make sure the password is not update (?) |
|
|
272 |
|
271 |
|
273 |
# Come from ModMember, but should not be possible (?) |
272 |
# Come from ModMember, but should not be possible (?) |
274 |
$self->dateenrolled(undef) unless $self->dateenrolled; |
273 |
$self->dateenrolled(undef) unless $self->dateenrolled; |
275 |
$self->dateexpiry(undef) unless $self->dateexpiry; |
274 |
$self->dateexpiry(undef) unless $self->dateexpiry; |
276 |
|
275 |
|
|
|
276 |
|
277 |
my $self_from_storage = $self->get_from_storage; |
277 |
# FIXME We should not deal with that here, callers have to do this job |
278 |
# FIXME We should not deal with that here, callers have to do this job |
278 |
# Moved from ModMember to prevent regressions |
279 |
# Moved from ModMember to prevent regressions |
279 |
unless ( $self->userid ) { |
280 |
unless ( $self->userid ) { |
280 |
my $stored_userid = $self->get_from_storage->userid; |
281 |
my $stored_userid = $self_from_storage->userid; |
281 |
$self->userid($stored_userid); |
282 |
$self->userid($stored_userid); |
282 |
} |
283 |
} |
283 |
|
284 |
|
|
|
285 |
# Password must be updated using $self->update_password |
286 |
$self->password($self_from_storage->password); |
287 |
|
284 |
if ( C4::Context->preference('FeeOnChangePatronCategory') |
288 |
if ( C4::Context->preference('FeeOnChangePatronCategory') |
285 |
and $self->category->categorycode ne |
289 |
and $self->category->categorycode ne |
286 |
$self->get_from_storage->category->categorycode ) |
290 |
$self_from_storage->category->categorycode ) |
287 |
{ |
291 |
{ |
288 |
$self->add_enrolment_fee_if_needed; |
292 |
$self->add_enrolment_fee_if_needed; |
289 |
} |
293 |
} |
Lines 311-317
sub store {
Link Here
|
311 |
} |
315 |
} |
312 |
|
316 |
|
313 |
my $borrowers_log = C4::Context->preference("BorrowersLog"); |
317 |
my $borrowers_log = C4::Context->preference("BorrowersLog"); |
314 |
my $previous_cardnumber = $self->get_from_storage->cardnumber; |
318 |
my $previous_cardnumber = $self_from_storage->cardnumber; |
315 |
if ($borrowers_log |
319 |
if ($borrowers_log |
316 |
&& ( !defined $previous_cardnumber |
320 |
&& ( !defined $previous_cardnumber |
317 |
|| $previous_cardnumber ne $self->cardnumber ) |
321 |
|| $previous_cardnumber ne $self->cardnumber ) |
Lines 678-684
sub update_password {
Link Here
|
678 |
eval { $self->userid($userid)->store; }; |
682 |
eval { $self->userid($userid)->store; }; |
679 |
return if $@; # Make sure the userid is not already in used by another patron |
683 |
return if $@; # Make sure the userid is not already in used by another patron |
680 |
|
684 |
|
681 |
return 0 if $password eq '****' or $password eq ''; # Do we need that? |
685 |
return 0 if $password eq '****' or $password eq ''; |
682 |
|
686 |
|
683 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
687 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
684 |
# Update the hashed PIN in borrower_sync.hashed_pin, before Koha hashes it |
688 |
# Update the hashed PIN in borrower_sync.hashed_pin, before Koha hashes it |
685 |
- |
|
|