From e946ab047f88bfc6af100c12bc4a717d384020ae Mon Sep 17 00:00:00 2001 From: Will Budicm Date: Mon, 14 Dec 2020 22:35:12 +1100 Subject: [PATCH] Session exp. times has to be validated not to be under 2 min. --- Current Development Check List.md | 9 +++++---- htdocs/cgi-bin/wsrc/main.js | 10 ++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Current Development Check List.md b/Current Development Check List.md index 00eb816..c99cd2c 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -6,12 +6,13 @@ ### v.2.1 SUN STABLE New Features in Works -* ✔ PostgreSQL to be further tested. Implement server managed database. - * On errors sessions appear not to be closed by driver, maybe this is required and they expire? - * Not all sql has been translated or proper database everywhere established. -* Session expired should disable the log entry form. +* ✔ Config. page set session expires times has to be validated not to be under 2 minutes. * Implement mapped provision of named timezones via main.inf, for towns not available in global list. * Javascript also needs to be updated to translate this properly. +* ✔ PostgreSQL to be further tested. Implement server managed database. + * On errors sessions appear not to be closed by driver, maybe this is required and they expire? + * Not all sql has been translated or proper database everywhere established. +* ✔ Session expired should disable the log entry form. * ✔ Implement log text field limit setting. 0 - Unlimited, 1024 - Default n>128 as minimum size. * ✔ System configuration variables should be sorted and listed by name and grouped by type. Anons presented at the bottom. * ✔ Provide office share public link for main.inf linked categories, No login required but no log creation or search is possible. diff --git a/htdocs/cgi-bin/wsrc/main.js b/htdocs/cgi-bin/wsrc/main.js index d0782b3..1f3184b 100644 --- a/htdocs/cgi-bin/wsrc/main.js +++ b/htdocs/cgi-bin/wsrc/main.js @@ -1145,17 +1145,24 @@ function setPageSessionTimer(expires) { var timeout; var now = new moment(); var val = expires.replace(/\+|[A-Z]|[a-z]/g, ''); + if(expires.indexOf("h")>0){ timeout = moment(now).add(val, "h"); } else if(expires.indexOf("m")>0){ + if(val<2){val=2}; timeout = moment(now).add(val, "m"); } else if(expires.indexOf("s")>0){ + if(val<60){val=2}; timeout = moment(now).add(val, "s"); } + else{ + if(val<2){val=2}; + timeout = moment(now).add(val, "m"); + } var timer = setInterval(function() { var now = new moment(); @@ -1168,6 +1175,9 @@ function setPageSessionTimer(expires) { if(now.isAfter(timeout)){ $("#sss_status").html("Page Session has Expired!"); clearInterval(timer); + $("#ed").prop( "disabled", true ); + $("#el").prop( "disabled", true ); + $("#am").prop( "disabled", true ); } }, 1000); -- 2.34.1