From 6304627d1871be4bf1f98b9672a3880bc8bfa712 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 --- .../perlmods/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 f72ac17f90..a8199c8809 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm @@ -232,11 +232,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); @@ -358,9 +365,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.11.0