Summary: | Sanitize input of timeout syspref | ||
---|---|---|---|
Product: | Koha | Reporter: | Pablo AB <pablo.bianchi> |
Component: | System Administration | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | aleisha, dcook, fridolin.somers, gmcharlt, ivan.dziuba, jonathan.druart, lucas, martin.renvoize, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00, 20.05.06, 19.11.12
|
|
Circulation function: | |||
Attachments: |
Bug 20804: Add tests
Bug 20804: Add support for "days" to the timeout syspref Bug 20804: Add support for "days" to the timeout syspref Bug 20804: Add tests Bug 20804: Add support for "days" to the timeout syspref Bug 20804: Add tests Bug 20804: Add support for "days" to the timeout syspref |
Description
Pablo AB
2018-05-23 05:54:55 UTC
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. |