View | Details | Raw Unified | Return to bug 28935
Collapse All | Expand All

(-)a/members/memberentry.pl (-1 / +4 lines)
Lines 47-52 use Koha::Token; Link Here
47
use Email::Valid;
47
use Email::Valid;
48
use Koha::SMS::Providers;
48
use Koha::SMS::Providers;
49
use Koha::Patron::Allowlist;
49
use Koha::Patron::Allowlist;
50
use Koha::Logger;
50
51
51
my $allowlist = Koha::Patron::Allowlist->new({ interface => 'staff' });
52
my $allowlist = Koha::Patron::Allowlist->new({ interface => 'staff' });
52
$allowlist->load;
53
$allowlist->load;
Lines 434-440 if ( defined $sms ) { Link Here
434
    $newdata{smsalertnumber} = $sms;
435
    $newdata{smsalertnumber} = $sms;
435
}
436
}
436
437
437
my $blocked = $allowlist->apply({ input => \%newdata, verbose => 1 }); # TODO Should we log results in $blocked ?
438
my $blocked = $allowlist->apply({ input => \%newdata, verbose => 1 });
439
Koha::Logger->get->debug( 'memberentry.pl: allowlist blocked fields: '.
440
    ( join ', ', map { $_. '='. $blocked->{$_} } sort keys %$blocked ) ) if keys %$blocked;
438
441
439
###  Error checks should happen before this line.
442
###  Error checks should happen before this line.
440
$nok = $nok || scalar(@errors);
443
$nok = $nok || scalar(@errors);
(-)a/opac/opac-memberentry.pl (-4 / +7 lines)
Lines 45-52 use Koha::Patron::Modifications; Link Here
45
use Koha::Patron::Categories;
45
use Koha::Patron::Categories;
46
use Koha::Token;
46
use Koha::Token;
47
use Koha::AuthorisedValues;
47
use Koha::AuthorisedValues;
48
49
use Koha::Patron::Allowlist;
48
use Koha::Patron::Allowlist;
49
use Koha::Logger;
50
50
51
my $allowlist = Koha::Patron::Allowlist->new;
51
my $allowlist = Koha::Patron::Allowlist->new;
52
$allowlist->load;
52
$allowlist->load;
Lines 138-144 if ( $action eq 'create' ) { Link Here
138
138
139
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q|| );
139
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q|| );
140
    $allowlist->remove( @unwanted_fields );
140
    $allowlist->remove( @unwanted_fields );
141
    my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); # TODO Log blocked data ?
141
    my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 });
142
    Koha::Logger->get->debug( 'opac-memberentry.pl: allowlist blocked fields: '.
143
        ( join ', ', map { $_. '='. $blocked->{$_} } sort keys %$blocked ) ) if keys %$blocked;
142
144
143
    my $cardnumber_error_code;
145
    my $cardnumber_error_code;
144
    if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) {
146
    if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) {
Lines 277-283 elsif ( $action eq 'update' ) { Link Here
277
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| );
279
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| );
278
    $allowlist->remove( @unwanted_fields );
280
    $allowlist->remove( @unwanted_fields );
279
    $allowlist->add( 'borrowernumber' ); # added because inserted after ParseCgi call
281
    $allowlist->add( 'borrowernumber' ); # added because inserted after ParseCgi call
280
    my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); # TODO Log blocked data ?
282
    my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 });
283
    Koha::Logger->get->debug( 'opac-memberentry.pl: allowlist blocked fields: '.
284
        ( join ', ', map { $_. '='. $blocked->{$_} } sort keys %$blocked ) ) if keys %$blocked;
281
285
282
    # Send back the data to the template
286
    # Send back the data to the template
283
    %borrower = ( %$borrower, %borrower );
287
    %borrower = ( %$borrower, %borrower );
284
- 

Return to bug 28935