From cefe15b467f4265e0a6f4024476ed02a63f3024b Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 2 Apr 2010 16:28:59 +0000 Subject: [PATCH] when auth session times out with embedded catalog, launch the xul login dialog (instead of flopping back to the home page) git-svn-id: svn://svn.open-ils.org/ILS/trunk@16105 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/opac_utils.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index dcec5f3909..2e09b66e3e 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -548,9 +548,27 @@ function grabUser(ses, force) { request.send(true); var user = request.result(); - if(!user) { - doLogout(); - return false; /* unable to grab the session */ + if(!user || user.textcode == 'NO_SESSION') { + + if(isXUL()) { + dojo.require('openils.XUL'); + openils.XUL.getNewSession( + function(success, authtoken) { + if(success) { + ses = authtoken; + var request = new Request(FETCH_SESSION, ses, 1); + request.request.alertEvent = false; + request.send(true); + user = request.result(); + } + } + ); + } + + if(!user || user.textcode == 'NO_SESSION') { + doLogout(); + return false; /* unable to grab the session */ + } } if( !(typeof user == 'object' && user._isfieldmapper) ) { -- 2.11.0