]> 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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 29 May 2024 14:43:25 +0000 (16:43 +0200)
commitaa1c4c0281039749fa024687049b32b375d78ec6
treef0664fa12ff835a37cce76162a5e855fafb62c52
parent15bf32a50a9c4cfff9e7b8b139f7fb639e90b331
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>
(cherry picked from commit 7e8803537254ec950c64327bece8091e6cf49499)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/db_dependent/Auth.t