Bug 36665: Add option to set the staff user's logged in branch based on their current ip
authorNick Clemens <nick@bywatersolutions.com>
Fri, 17 May 2024 11:59:21 +0000 (11:59 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Wed, 22 May 2024 14:18:12 +0000 (16:18 +0200)
commit3a0d6f5d07b914ab03f9ae3c56b033158bd91130
tree027544588bb4cdd0c7db96caf8f8d2a41f517059
parent678e3f6e208ed47820132215806519f5162545fb
Bug 36665: Add option to set the staff user's logged in branch based on their current ip

This patch adds a new system preference StaffLoginBranchBasedOnIP which restores the behaviour before bug 35918
of using the current IP to determine the user's logged in branchcode

To test:
 1 - Get your current ip
 2 - Set that IP for a library in the administration section
 3 - Find a user account assigned to a different library that can login to staff side
 4 - Login to staff as that user, select 'My library'
 5 - You are logged in to the user's branch
 6 - Apply patch, restart all
 7 - Log out and back in, selecting 'My library'
 8 - You are logged in to the user's branch
 9 - Enable new system preference StaffLoginBranchBasedOnIP
 9 - Log out and back in, selecting a different branch, noting the new warning below the library selection
10 - You are logged in to the branch with the matching IP
11 - Log out and back in, selecting 'My library'
10 - You are logged in to the branch with the matching IP
11 - Change your logged in branch
12 - Verify the selection sticks and you can perform staff actions in the chosen branch
13 - Change the IP of the library to one that doesn't match yours
14 - Verify you can log out and log back in and that selected branch is respected when your IP doesn't match library IP

Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
C4/Auth.pm
installer/data/mysql/atomicupdate/bug_36665.pl [new file with mode: 0755]
installer/data/mysql/mandatory/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
t/db_dependent/Auth.t