I naively change timeout syspref from default "1d" to "2h". I get logout immediatly, and after login again, at the first clic I was logged out again, with any user, even with koha_instance. plack-error.log Use of uninitialized value $lasttime in numeric lt (<) at /usr/share/koha/lib/C4/Auth.pm line 1425. Argument "2h" isn't numeric in subtraction (-) at /usr/share/koha/lib/C4/Auth.pm line 1425. Argument "2h" isn't numeric in subtraction (-) at /usr/share/koha/lib/C4/Auth.pm line 862. I was back again with via sql update (value='1d') and flushing memcached. I suggest: - Don't been possible to input an invalid input on timeout (well, on any, but for the moment on this one). m/^[0-9]*[dD]?$/ - This syspref (maybe others also) shouldn't apply to koha_instance user (God shouldn't be able to microwave a burrito so hot he himself couldn't eat it). Would be great 30m and 2h for minutes and hours, but that should be other bug.
Created attachment 107587 [details] [review] Bug 20804: Add tests
Created attachment 107588 [details] [review] Bug 20804: Add support for "days" to the timeout syspref If the timeout syspref did not contain an integer, or was not matching integer.'d|D', then it "fallback" to 0 We can easily add support for hours and fallback to 600 if the value is not correct. It will prevent the session to timeout immediately Test plan: 0. Do not apply the patches 1. Fill the timeout syspref with "5m" 2. Login 3. Click somewhere => Notice that the session timed out 4. Apply the patches, restart_all 5. Login 6. Click somewhere => You have 5 minutes to enjoy Koha 7. Fill the pref with an incorrect value ("5x" for instance) 8. Logout, login 9. There is a warning in the log, and you have 10 minutes to enjoy Koha
Ivan, you modified the status but there is no signed off patches attached.
> 1. Fill the timeout syspref with "5m" But minutes are not supported, only days and hours.
Also if invalid value, warn will be logged at each page. I'd say we better tell default behavior in system preference description. Also add in the description you can use h/H for hours.
Created attachment 109688 [details] [review] Bug 20804: Add support for "days" to the timeout syspref If the timeout syspref did not contain an integer, or was not matching integer.'d|D', then it "fallback" to 0 We can easily add support for hours and fallback to 600 if the value is not correct. It will prevent the session to timeout immediately Test plan: 0. Do not apply the patches 1. Fill the timeout syspref with "5h" 2. Login 3. Click somewhere => Notice that the session timed out 4. Apply the patches, restart_all 5. Login 6. Click somewhere => You have 5 hours to enjoy Koha 7. Fill the pref with an incorrect value ("5x" for instance) 8. Logout, login 9. There is a warning in the log, and you have 10 minutes (600 secondes) to enjoy Koha
(In reply to Fridolin SOMERS from comment #5) > Also if invalid value, warn will be logged at each page. > I'd say we better tell default behavior in system preference description. > Also add in the description you can use h/H for hours. I think we want to be verbose if the value is not correct.
Created attachment 111160 [details] [review] Bug 20804: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 111161 [details] [review] Bug 20804: Add support for "days" to the timeout syspref If the timeout syspref did not contain an integer, or was not matching integer.'d|D', then it "fallback" to 0 We can easily add support for hours and fallback to 600 if the value is not correct. It will prevent the session to timeout immediately Test plan: 0. Do not apply the patches 1. Fill the timeout syspref with "5h" 2. Login 3. Click somewhere => Notice that the session timed out 4. Apply the patches, restart_all 5. Login 6. Click somewhere => You have 5 hours to enjoy Koha 7. Fill the pref with an incorrect value ("5x" for instance) 8. Logout, login 9. There is a warning in the log, and you have 10 minutes (600 secondes) to enjoy Koha Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This works well and I agree with the verbosity of the errors. Signing off
Created attachment 111547 [details] [review] Bug 20804: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 111548 [details] [review] Bug 20804: Add support for "days" to the timeout syspref If the timeout syspref did not contain an integer, or was not matching integer.'d|D', then it "fallback" to 0 We can easily add support for hours and fallback to 600 if the value is not correct. It will prevent the session to timeout immediately Test plan: 0. Do not apply the patches 1. Fill the timeout syspref with "5h" 2. Login 3. Click somewhere => Notice that the session timed out 4. Apply the patches, restart_all 5. Login 6. Click somewhere => You have 5 hours to enjoy Koha 7. Fill the pref with an incorrect value ("5x" for instance) 8. Logout, login 9. There is a warning in the log, and you have 10 minutes (600 secondes) to enjoy Koha Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.06
backported to 19.11.x for 19.11.12
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.