Bug 20804: Add support for "days" to the timeout syspref
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 30 Jul 2020 13:15:46 +0000 (15:15 +0200)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 13 Nov 2020 14:35:00 +0000 (14:35 +0000)
commit78e8c65bf5fa8db6b9a8e8f3313359a4f295c00d
tree8b557d1452631780dbc725bc818b0c071d4aa9cb
parent356d1ca888b3591bde960f30c43e6afcd93b66dc
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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 97b9eab178f0b45b38662747a4e009e71d8b73ff)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Auth.pm