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

(-)a/C4/Members.pm (-1 / +15 lines)
Lines 355-360 true on success, or false on failure Link Here
355
355
356
sub ModMember {
356
sub ModMember {
357
    my (%data) = @_;
357
    my (%data) = @_;
358
359
    # trim whitespace from data which has some non-whitespace in it.
360
    foreach my $field_name (keys(%data)) {
361
        if ( defined $data{$field_name} && $data{$field_name} =~ /\S/ ) {
362
            $data{$field_name} =~ s/^\s*|\s*$//g;
363
        }
364
    }
365
358
    # test to know if you must update or not the borrower password
366
    # test to know if you must update or not the borrower password
359
    if (exists $data{password}) {
367
    if (exists $data{password}) {
360
        if ($data{password} eq '****' or $data{password} eq '') {
368
        if ($data{password} eq '****' or $data{password} eq '') {
Lines 442-447 sub AddMember { Link Here
442
    my $dbh = C4::Context->dbh;
450
    my $dbh = C4::Context->dbh;
443
    my $schema = Koha::Database->new()->schema;
451
    my $schema = Koha::Database->new()->schema;
444
452
453
    # trim whitespace from data which has some non-whitespace in it.
454
    foreach my $field_name (keys(%data)) {
455
        if ( defined $data{$field_name} && $data{$field_name} =~ /\S/ ) {
456
            $data{$field_name} =~ s/^\s*|\s*$//g;
457
        }
458
    }
459
445
    # generate a proper login if none provided
460
    # generate a proper login if none provided
446
    $data{'userid'} = Generate_Userid( $data{'borrowernumber'}, $data{'firstname'}, $data{'surname'} )
461
    $data{'userid'} = Generate_Userid( $data{'borrowernumber'}, $data{'firstname'}, $data{'surname'} )
447
      if ( $data{'userid'} eq '' || !Check_Userid( $data{'userid'} ) );
462
      if ( $data{'userid'} eq '' || !Check_Userid( $data{'userid'} ) );
448
- 

Return to bug 15702