|
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 $allowed_data = { %borrower }; |
| 142 |
$allowlist->apply({ input => $allowed_data }); # TODO Log blocked data ? |
| 143 |
%borrower = %$allowed_data; |
| 140 |
|
144 |
|
| 141 |
my $cardnumber_error_code; |
145 |
my $cardnumber_error_code; |
| 142 |
if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) { |
146 |
if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) { |
|
Lines 276-282
elsif ( $action eq 'update' ) {
Link Here
|
| 276 |
%borrower = ( %$borrower, %borrower ); |
280 |
%borrower = ( %$borrower, %borrower ); |
| 277 |
|
281 |
|
| 278 |
my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| ); |
282 |
my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| ); |
| 279 |
$ui_allowlist->apply({ input => \%borrower, additional_deny_list => \@unwanted_fields }); |
283 |
$allowlist->remove( @unwanted_fields ); |
|
|
284 |
my $allowed_data = { %borrower }; |
| 285 |
$allowlist->apply({ input => $allowed_data }); # TODO Log blocked data ? |
| 286 |
%borrower = %$allowed_data; |
| 280 |
|
287 |
|
| 281 |
if (@empty_mandatory_fields || @$invalidformfields) { |
288 |
if (@empty_mandatory_fields || @$invalidformfields) { |
| 282 |
$template->param( |
289 |
$template->param( |
| 283 |
- |
|
|