Bug 36378

Summary: Cannot stay logged in if AutoLocation is enabled but library's IP address is not set correctly
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall (khall) <kyle>
Status: Pushed to oldstable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,24.05.12
Circulation function:
Bug Depends on:    
Bug Blocks: 36427    
Attachments: Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly
Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly
Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly

Description Kyle M Hall (khall) 2024-03-20 19:08:30 UTC
We can get into a scenario what a user cannot stay logged in for more than a single page load. If AutoLocation is enabled without branch IP addresses being set, you will be logged out with every page load.
Comment 1 Kyle M Hall (khall) 2024-03-20 19:23:30 UTC
It looks like branchip has to contain a space to trigger the issue.
Comment 2 Kyle M Hall (khall) 2024-03-20 19:34:54 UTC
Created attachment 163576 [details] [review]
Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly

We can get into a scenario what a user cannot stay logged in for more than a single page load.
If AutoLocation is enabled with branch IP addresses being set to a space, you will be logged out with every page load.

Test Plan:
1) Set your branch ip to a space
2) Enable AutoLocation
3) Restart all the things!
4) Log out
5) Log in
6) Browse to another page
7) You are logged out
8) Apply patch
9) Repeat 1-6
10) You are not logged out!
Comment 3 Kyle M Hall (khall) 2024-03-20 19:35:32 UTC
I think maybe a future enhancement would be to validate the branch ip when it is  saved.
Comment 4 Andrew Fuerste-Henry 2024-03-22 15:44:28 UTC
Created attachment 163716 [details] [review]
Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly

We can get into a scenario what a user cannot stay logged in for more than a single page load.
If AutoLocation is enabled with branch IP addresses being set to a space, you will be logged out with every page load.

Test Plan:
1) Set your branch ip to a space
2) Enable AutoLocation
3) Restart all the things!
4) Log out
5) Log in
6) Browse to another page
7) You are logged out
8) Apply patch
9) Repeat 1-6
10) You are not logged out!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Comment 5 Martin Renvoize (ashimema) 2024-05-13 10:19:42 UTC
Created attachment 166625 [details] [review]
Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly

We can get into a scenario what a user cannot stay logged in for more than a single page load.
If AutoLocation is enabled with branch IP addresses being set to a space, you will be logged out with every page load.

Test Plan:
1) Set your branch ip to a space
2) Enable AutoLocation
3) Restart all the things!
4) Log out
5) Log in
6) Browse to another page
7) You are logged out
8) Apply patch
9) Repeat 1-6
10) You are not logged out!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize (ashimema) 2024-05-13 10:20:43 UTC
I agree.. it would be great to validate this field at a later date and I'm glad to see there's a bug report for that now too.

For now, however, this catches the case and resolves the misconfiguration issue.

Passing QA
Comment 7 Katrin Fischer 2024-05-14 13:35:16 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 8 Fridolin Somers 2024-05-29 12:32:48 UTC
Pushed to 23.11.x for 23.11.06
Comment 9 Lucas Gass (lukeg) 2024-05-30 19:28:47 UTC
Backported to 23.05.x for upcoming 23.05.12