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

(-)a/C4/Auth_with_shibboleth.pm (-1 / +1 lines)
Lines 256-262 This is as simple as enabling B<useshibboleth> in koha-conf.xml: Link Here
256
Map shibboleth attributes to koha fields, and configure authentication match point in koha-conf.xml.
256
Map shibboleth attributes to koha fields, and configure authentication match point in koha-conf.xml.
257
257
258
 <shibboleth>
258
 <shibboleth>
259
   <matchpoint>userid<matchpoint> <!-- koha borrower field to match upon -->
259
   <matchpoint>userid</matchpoint> <!-- koha borrower field to match upon -->
260
   <mapping>
260
   <mapping>
261
     <userid is="eduPersonID"></userid> <!-- koha borrower field to shibboleth attribute mapping -->
261
     <userid is="eduPersonID"></userid> <!-- koha borrower field to shibboleth attribute mapping -->
262
   </mapping>
262
   </mapping>
(-)a/C4/Members.pm (-2 lines)
Lines 1291-1298 sub AddMember_Opac { Link Here
1291
        $borrower{'password'} = $password;
1291
        $borrower{'password'} = $password;
1292
    }
1292
    }
1293
1293
1294
    $borrower{'cardnumber'} = fixup_cardnumber( $borrower{'cardnumber'} );
1295
1296
    %borrower = AddMember_Auto(%borrower);
1294
    %borrower = AddMember_Auto(%borrower);
1297
1295
1298
    return ( $borrower{'borrowernumber'}, $borrower{'password'} );
1296
    return ( $borrower{'borrowernumber'}, $borrower{'password'} );
(-)a/t/db_dependent/Members.t (-5 / +16 lines)
Lines 17-25 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 64;
20
use Test::More tests => 65;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Data::Dumper;
22
use Data::Dumper qw/Dumper/;
23
use C4::Context;
23
use C4::Context;
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::Holds;
25
use Koha::Holds;
Lines 37-43 my $schema = Koha::Database->schema; Link Here
37
$schema->storage->txn_begin;
37
$schema->storage->txn_begin;
38
my $builder = t::lib::TestBuilder->new;
38
my $builder = t::lib::TestBuilder->new;
39
my $dbh = C4::Context->dbh;
39
my $dbh = C4::Context->dbh;
40
$dbh->{RaiseError} = 1;
41
40
42
# Remove invalid guarantorid's as long as we have no FK
41
# Remove invalid guarantorid's as long as we have no FK
43
$dbh->do("UPDATE borrowers b1 LEFT JOIN borrowers b2 ON b2.borrowernumber=b1.guarantorid SET b1.guarantorid=NULL where b1.guarantorid IS NOT NULL AND b2.borrowernumber IS NULL");
42
$dbh->do("UPDATE borrowers b1 LEFT JOIN borrowers b2 ON b2.borrowernumber=b1.guarantorid SET b1.guarantorid=NULL where b1.guarantorid IS NOT NULL AND b2.borrowernumber IS NULL");
Lines 491-494 eval { Link Here
491
is($@, '', 'Bug 16009: GetMember(cardnumber => undef) works');
490
is($@, '', 'Bug 16009: GetMember(cardnumber => undef) works');
492
is($patron, undef, 'Bug 16009: GetMember(cardnumber => undef) returns undef');
491
is($patron, undef, 'Bug 16009: GetMember(cardnumber => undef) returns undef');
493
492
494
1;
493
subtest 'Trivial test for AddMember_Auto' => sub {
494
    plan tests => 3;
495
    my $members_mock = Test::MockModule->new( 'C4::Members' );
496
    $members_mock->mock( 'fixup_cardnumber', sub { 12345; } );
497
    my $library = $builder->build({ source => 'Branch' });
498
    my $category = $builder->build({ source => 'Category' });
499
    my %borr = AddMember_Auto( surname=> 'Dick3', firstname => 'Philip', branchcode => $library->{branchcode}, categorycode => $category->{categorycode}, password => '34567890' );
500
    ok( $borr{borrowernumber}, 'Borrower hash contains borrowernumber' );
501
    is( $borr{cardnumber}, 12345, 'Borrower hash contains cardnumber' );
502
    $patron = Koha::Patrons->find( $borr{borrowernumber} );
503
    isnt( $patron, undef, 'Patron found' );
504
};
505
506
$schema->storage->txn_rollback;
495
- 

Return to bug 12026