]> git.koha-community.org Git - koha.git/commit
Bug 36908: Additional unit tests to identify flaw when two branches have same IP
authorNick Clemens <nick@bywatersolutions.com>
Tue, 21 May 2024 12:26:34 +0000 (12:26 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Thu, 23 May 2024 15:51:16 +0000 (17:51 +0200)
commit7e8803537254ec950c64327bece8091e6cf49499
tree5e7f7372e1265a096f5d6fe0b8639d200c22ad23
parent6966fcc398d3a87edba95aa987d915a1b00eb08f
Bug 36908: Additional unit tests to identify flaw when two branches have same IP

This could be considered a configuration flaw, but when:
StaffLoginBranchBasedOnIP enabled and not AutoLocation
or
AutoLocation enabledand no IP set in user's branch

AND

two branches have the same IP set

the user can be logged in randomly to one of the matching branches.

These test often pass, but will also randomly fail

Easier to verify with a one liner demonstrating current code:
perl -e 'use Koha::Libraries; use List::MoreUtils qw(uniq); my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list }; my $branchcode="CPL"; warn Data::Dumper::Dumper( uniq( $branchcode, keys %$branches ));'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
t/db_dependent/Auth.t