Bugzilla – Attachment 22115 Details for
Bug 10016
SelfCheckTimeout not logging patron out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug 10016: munge history in SCO to discourage resubmitting user login
bug-10016-munge-history-in-SCO-to-discourage-resub.patch (text/plain), 4.82 KB, created by
Galen Charlton
on 2013-10-20 21:22:38 UTC
(
hide
)
Description:
bug 10016: munge history in SCO to discourage resubmitting user login
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2013-10-20 21:22:38 UTC
Size:
4.82 KB
patch
obsolete
>From a2e56dee75fe31b661c6866691dca27926252521 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Sun, 20 Oct 2013 20:55:06 +0000 >Subject: [PATCH] bug 10016: munge history in SCO to discourage resubmitting > user login > >This patch uses history.replaceState (introduced in HTML5) to manipulate >the browser history to encourage returning to the SCO patron barcode >form if the back button is used. > >Note that a side effect of this patch is that if the user uses >the help link, they will be prompted to enter their barcode >again. It may be better to put the help inline with the rest >of the SCO forms. > >To test: > >[1] Start a web-based self-check session. >[2] Enter a patron barcode. >[3] Allow the self-check session to time out. >[4] Use the back button. You should get the patron barcode > entry form; you should not be prompted to resubmit form input. >[5] Enter a patron barcode, perform some transactions, then > use the finish button. >[6] Next, use the back button. You should get the patron barcode > entry form. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >--- > .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 16 +++++++++++++--- > koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt | 14 ++++++++++++-- > 2 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 922a0db..4588912 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -16,7 +16,7 @@ > </script> > <script type="text/javascript" src="[% interface %]/[% theme %]/lib/modernizr.min.js"></script> > </head> >-<body onload="dofocus();"> >+<body onload="dofocus();" onunload="mungeHistory();"> > [% INCLUDE 'masthead-sco.inc' %] > > <div class="main"> >@@ -309,8 +309,17 @@ > [% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > //<![CDATA[ >+ function mungeHistory() { >+ // prevent back button from allowing form resubmission >+ if (history && history.pushState) { >+ history.replaceState(null, document.title, this.href); >+ } >+ } >+ var mainTimeout; > function sco_init() { >- setTimeout("location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';",[% SelfCheckTimeout %]); >+ mainTimeout = setTimeout(function() { >+ location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; >+ }, [% SelfCheckTimeout %]); > } > function dofocus() { // named function req'd for body onload event by some FF and IE7 security models > // alert("dofocus called"); >@@ -346,6 +355,7 @@ > })); > > $("#logout_form").submit(function(){ >+ clearTimeout(mainTimeout); > if(confirm("Would you like to print a receipt?")){ > window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&print=qslip"); > } >@@ -357,4 +367,4 @@ > > [% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %] > [% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %] >-[% END %] >\ No newline at end of file >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >index 3803368..ed1db76 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >@@ -15,8 +15,17 @@ > </script> > [% INCLUDE 'datatables.inc' %] > <script type="text/javascript">//<![CDATA[ >+function mungeHistory() { >+ // prevent back button from allowing form resubmission >+ if (history && history.pushState) { >+ history.replaceState(null, document.title, this.href); >+ } >+} >+var mainTimeout; > function sco_init() { >- setTimeout("location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';",[% SelfCheckTimeout %]); >+ mainTimeout = setTimeout(function() { >+ location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; >+ }, [% SelfCheckTimeout %]); > } > function dofocus() { // named function req'd for body onload event by some FF and IE7 security models > // alert("dofocus called"); >@@ -80,6 +89,7 @@ $(document).ready(function() { > ] > })); > $("#logout_form").submit(function(){ >+ clearTimeout(mainTimeout); > if(confirm("Would you like to print a receipt?")){ > window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&print=qslip"); > } >@@ -96,7 +106,7 @@ $(document).ready(function() { > [% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %] > > </head> >-<body onload="dofocus();"> >+<body onload="dofocus();" onunload="mungeHistory();"> > > <div id="doc" class="yui-t7"> > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10016
:
22115
|
22116
|
22117
|
22126
|
22127
|
22129
|
22130
|
22131
|
22132
|
22140
|
22141