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

(-)a/members/memberentry.pl (-3 / +3 lines)
Lines 48-55 use Email::Valid; Link Here
48
use Koha::SMS::Providers;
48
use Koha::SMS::Providers;
49
use Koha::Patron::Allowlist;
49
use Koha::Patron::Allowlist;
50
50
51
my $ui_allowlist = Koha::Patron::Allowlist->new({ interface => 'staff' });
51
my $allowlist = Koha::Patron::Allowlist->new({ interface => 'staff' });
52
52
$allowlist->load;
53
53
54
my $input = CGI->new;
54
my $input = CGI->new;
55
my %data;
55
my %data;
Lines 434-440 if ( defined $sms ) { Link Here
434
    $newdata{smsalertnumber} = $sms;
434
    $newdata{smsalertnumber} = $sms;
435
}
435
}
436
436
437
$ui_allowlist->apply({ input => \%newdata });
437
my $blocked = $allowlist->apply({ input => \%newdata, verbose => 1 }); # TODO Should we log results in $blocked ?
438
438
439
###  Error checks should happen before this line.
439
###  Error checks should happen before this line.
440
$nok = $nok || scalar(@errors);
440
$nok = $nok || scalar(@errors);
(-)a/opac/opac-memberentry.pl (-6 / +9 lines)
Lines 48-54 use Koha::AuthorisedValues; Link Here
48
48
49
use Koha::Patron::Allowlist;
49
use Koha::Patron::Allowlist;
50
50
51
my $ui_allowlist = Koha::Patron::Allowlist->new();
51
my $allowlist = Koha::Patron::Allowlist->new;
52
$allowlist->load;
52
53
53
my $cgi = CGI->new;
54
my $cgi = CGI->new;
54
my $dbh = C4::Context->dbh;
55
my $dbh = C4::Context->dbh;
Lines 136-142 if ( $action eq 'create' ) { Link Here
136
    delete $borrower{'password2'};
137
    delete $borrower{'password2'};
137
138
138
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q|| );
139
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q|| );
139
    $ui_allowlist->apply({ input => \%borrower, additional_deny_list => \@unwanted_fields });
140
    $allowlist->remove( @unwanted_fields );
141
    my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); # TODO Log blocked data ?
140
142
141
    my $cardnumber_error_code;
143
    my $cardnumber_error_code;
142
    if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) {
144
    if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) {
Lines 272-283 elsif ( $action eq 'update' ) { Link Here
272
      ( CheckMandatoryFields( \%borrower, $action ), CheckMandatoryAttributes( \%borrower, $attributes ) );
274
      ( CheckMandatoryFields( \%borrower, $action ), CheckMandatoryAttributes( \%borrower, $attributes ) );
273
    my $invalidformfields = CheckForInvalidFields(\%borrower);
275
    my $invalidformfields = CheckForInvalidFields(\%borrower);
274
276
277
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| );
278
    $allowlist->remove( @unwanted_fields );
279
    $allowlist->add( 'borrowernumber' ); # added because inserted after ParseCgi call
280
    my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); # TODO Log blocked data ?
281
275
    # Send back the data to the template
282
    # Send back the data to the template
276
    %borrower = ( %$borrower, %borrower );
283
    %borrower = ( %$borrower, %borrower );
277
284
278
    my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| );
279
    $ui_allowlist->apply({ input => \%borrower, additional_deny_list => \@unwanted_fields });
280
281
    if (@empty_mandatory_fields || @$invalidformfields) {
285
    if (@empty_mandatory_fields || @$invalidformfields) {
282
        $template->param(
286
        $template->param(
283
            empty_mandatory_fields => \@empty_mandatory_fields,
287
            empty_mandatory_fields => \@empty_mandatory_fields,
284
- 

Return to bug 28935