From: Bill Erickson Date: Wed, 28 Aug 2013 17:41:21 +0000 (-0400) Subject: LP#1218597 tpac self-reg refresh page for privacy X-Git-Tag: sprint4-merge-nov22~2736 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f579796ba830f516deefb7fcfb79740abdcce837;p=working%2FEvergreen.git LP#1218597 tpac self-reg refresh page for privacy Adding a new org unit setting "opac.self_register.timeout" / "Patron Self-Reg. Display Timeout" for determning how long the self-reg page will remain open before reloading to the home page. The goal is to protect the privacy of those who enter values but fail to submit the form. Signed-off-by: Bill Erickson Conflicts: Open-ILS/src/sql/Pg/950.data.seed-values.sql Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm index cdbe9a42a5..cf6a987d97 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm @@ -206,6 +206,10 @@ sub collect_register_validation_settings { unless defined $shash->{stgu}{usrname}{show}; $ctx->{register}{settings} = $shash; + + # laod the page timeout setting + $shash->{refresh_timeout} = + $ctx->{get_org_setting}->($ctx_org, 'opac.self_register.timeout'); } # inspects each value and determines, based on org unit settings, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index aa54759862..9e913c32de 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -13376,8 +13376,6 @@ VALUES ( ); - - INSERT into config.org_unit_setting_type (name, grp, label, description, datatype) VALUES ( @@ -13410,3 +13408,24 @@ VALUES ( TRUE ); +INSERT INTO config.org_unit_setting_type + (name, grp, datatype, label, description) +VALUES ( + 'opac.self_register.timeout', + 'opac', + 'integer', + oils_i18n_gettext( + 'opac.self_register.timeout', + 'Patron Self-Reg. Display Timeout', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.self_register.timeout', + 'Number of seconds to wait before reloading the patron self-'|| + 'registration interface to clear sensitive data', + 'coust', + 'description' + ) +); + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.self-reg-timeout.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.self-reg-timeout.sql new file mode 100644 index 0000000000..30e2fa7c85 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.self-reg-timeout.sql @@ -0,0 +1,24 @@ +BEGIN; + +INSERT INTO config.org_unit_setting_type + (name, grp, datatype, label, description) +VALUES ( + 'opac.self_register.timeout', + 'opac', + 'integer', + oils_i18n_gettext( + 'opac.self_register.timeout', + 'Patron Self-Reg. Display Timeout', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.self_register.timeout', + 'Number of seconds to wait before reloading the patron self-'|| + 'registration interface to clear sensitive data', + 'coust', + 'description' + ) +); + +COMMIT; diff --git a/Open-ILS/src/templates/opac/register.tt2 b/Open-ILS/src/templates/opac/register.tt2 index f307b7f5a4..1e80cf6e8a 100644 --- a/Open-ILS/src/templates/opac/register.tt2 +++ b/Open-ILS/src/templates/opac/register.tt2 @@ -4,6 +4,10 @@ INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Request Library Card"); +# for privacy, reload the page after (default) 5 minutes +refresh_time = ctx.register.settings.refresh_timeout || 300; +ctx.refresh = refresh_time _ '; ' _ ctx.opac_root _ '/home'; + # some useful variables and MACROs for display, # field validation, and added info display