Bugzilla – Attachment 175210 Details for
Bug 36586
Self-checkouts will get CSRF errors if left inactive for 8 hours
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36586: WIP
Bug-36586-WIP.patch (text/plain), 2.90 KB, created by
Nick Clemens (kidclamp)
on 2024-12-04 21:14:08 UTC
(
hide
)
Description:
Bug 36586: WIP
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-12-04 21:14:08 UTC
Size:
2.90 KB
patch
obsolete
>From 5478b6244c25159c24658a7cbfb74c3cb6a44797 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 4 Dec 2024 21:10:55 +0000 >Subject: [PATCH] Bug 36586: WIP > >This patch moves the refresh code into a js include and sets a few variables in the page. >It also moves the fetch of the pref into the template. > >We need to copy this over for the sco - and probably add a new pref. > >Lastly, the code here only refreshes during an active session, probably we could have a single pref >SelfCheckRefresh >that would trigger on the main page, default to 3 or 4 hours? >--- > .../bootstrap/en/modules/sci/sci-main.tt | 28 ++++--------------- > opac/sci/sci-main.pl | 4 --- > 2 files changed, 5 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >index 8308303626a..7d9326c34c3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >@@ -202,6 +202,7 @@ > > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >+[% Asset.js('js/timeout.js') | $raw %] > <script> > > function mungeHistory() { >@@ -273,29 +274,10 @@ > }); > > >- var idleTime = 0; >- $(document).ready(function () { >- //Increment the idle time counter every second >- var idleInterval = setInterval(timerIncrement, 1000); >- >- //Zero the idle timer on mouse movement. >- $(this).mousemove(function (e) { >- idleTime = 0; >- }); >- $(this).keypress(function (e) { >- idleTime = 0; >- }); >- }); >- >- function timerIncrement() { >- if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) { >- idleTime = idleTime + 1; >- idleTimeout = [% refresh_timeout | html %]; >- if (idleTime >= idleTimeout ) { >- location.href = '/cgi-bin/koha/sci/sci-main.pl'; >- } >- } >- } >+ let idleTimeout = [% Koha.Preference('SelfCheckInTimeOut') || 120 %]; >+ let refresh_button = $("#sci_refresh_button"); >+ let finish_button = $("#sci_finish_button"); >+ let home_href = "/cgi-bin/koha/sci/sci-main.pl"; > > > function checkBarcodeInput() { >diff --git a/opac/sci/sci-main.pl b/opac/sci/sci-main.pl >index d2fdca9e103..8c8c04965e6 100755 >--- a/opac/sci/sci-main.pl >+++ b/opac/sci/sci-main.pl >@@ -105,8 +105,4 @@ if ( $op eq 'cud-check_in' ) { > $template->param( success => \@success, errors => \@errors, checkins => 1 ); > } > >-# Make sure timeout has a reasonable value >-my $timeout = C4::Context->preference('SelfCheckInTimeout') || 120; >-$template->param( refresh_timeout => $timeout ); >- > output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 }; >-- >2.39.5
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 36586
:
175210
|
175239
|
175919