From 16c65efba41d5fd44bb0ee3f73ba485143a62ed5 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 4 Jan 2013 14:33:28 -0500 Subject: [PATCH] fix user session management for MARC Batch Edit The Javascript in the hardcoded page templates was not checking the XUL stash for the session key when run from the staff client; this is now needed as a result of the XULRunner updates introdued by commit adee850f. As a consequence, the list of the user's record buckets was not retrieved, and attempts to run a batch edit would spin without updating any records. This fixes LP#1048707 and LP#1054277. Signed-off-by: Galen Charlton Signed-off-by: Mike Rylander --- .../lib/OpenILS/WWW/TemplateBatchBibUpdate.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm index 6eb3064368..5f46799545 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm @@ -233,11 +233,18 @@ sub show_processing_template { dojo.require('fieldmapper.AutoIDL'); dojo.require('fieldmapper.dojoData'); dojo.require('openils.User'); + dojo.require('openils.XUL'); + dojo.require('dojo.cookie'); dojo.require('openils.CGI'); dojo.require('openils.widget.ProgressDialog'); var cgi = new openils.CGI(); - var u = new openils.User({ authcookie : 'ses' }); + var authtoken = dojo.cookie('ses') || cgi.param('ses'); + if (!authtoken && openils.XUL.isXUL()) { + var stash = openils.XUL.getStash(); + authtoken = stash.session.key; + } + var u = new openils.User({ authtoken: authtoken }); dojo.addOnLoad(function () { progress_dialog.show(true); @@ -359,9 +366,16 @@ sub show_template { dojo.require('fieldmapper.dojoData'); dojo.require('openils.User'); dojo.require('openils.CGI'); + dojo.require('openils.XUL'); + dojo.require('dojo.cookie'); var cgi = new openils.CGI(); - var u = new openils.User({ authcookie : 'ses' }); + var authtoken = dojo.cookie('ses') || cgi.param('ses'); + if (!authtoken && openils.XUL.isXUL()) { + var stash = openils.XUL.getStash(); + authtoken = stash.session.key; + } + var u = new openils.User({ authtoken: authtoken }); var bucketStore = new dojo.data.ItemFileReadStore( { data : cbreb.toStoreData( -- 2.43.2