[open-ils-commits] r18107 - in branches/rel_2_0/Open-ILS/web: js/dojo/openils js/ui opac/common/js (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 29 16:50:23 EDT 2010
Author: phasefx
Date: 2010-09-29 16:50:18 -0400 (Wed, 29 Sep 2010)
New Revision: 18107
Modified:
branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js
branches/rel_2_0/Open-ILS/web/js/ui/base.js
branches/rel_2_0/Open-ILS/web/opac/common/js/opac_utils.js
Log:
merge r18106 from trunk for needless auth prompting
Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js 2010-09-29 20:49:05 UTC (rev 18106)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js 2010-09-29 20:50:18 UTC (rev 18107)
@@ -16,15 +16,17 @@
if(openils.XUL.isXUL()) {
try {
if(openils.XUL.enableXPConnect()) {
- var CacheClass = new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
- return new CacheClass().wrappedJSObject.OpenILS.prototype.data;
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+ var CacheClass = new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
+ return new CacheClass().wrappedJSObject.OpenILS.prototype.data;
}
} catch(e) {
console.log("Error loading XUL stash: " + e);
+ return { 'error' : e };
}
}
- return {};
+ return { 'error' : 'openils.XUL.isXUL() == false' };
}
openils.XUL.newTab = function(path, tabInfo, options) {
Modified: branches/rel_2_0/Open-ILS/web/js/ui/base.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/base.js 2010-09-29 20:49:05 UTC (rev 18106)
+++ branches/rel_2_0/Open-ILS/web/js/ui/base.js 2010-09-29 20:50:18 UTC (rev 18107)
@@ -19,6 +19,11 @@
openils.User.authtoken = null;
openils.User.workstation = null;
+ if(!authtoken && openils.XUL.isXUL()) {
+ stash = openils.XUL.getStash();
+ authtoken = stash.session.key
+ }
+
if(authtoken) {
user = new openils.User();
delete user.sessionCache[authtoken];
@@ -38,6 +43,7 @@
dojo.addOnLoad(function(){
if(openils.XUL.isXUL()) {
// let XUL handle the login dialog
+ dump('getNewSession in base.js\n');
openils.XUL.getNewSession( function() { location.href = location.href } );
} else {
// in web-only mode, use the dojo login dialog
Modified: branches/rel_2_0/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/common/js/opac_utils.js 2010-09-29 20:49:05 UTC (rev 18106)
+++ branches/rel_2_0/Open-ILS/web/opac/common/js/opac_utils.js 2010-09-29 20:50:18 UTC (rev 18107)
@@ -536,6 +536,7 @@
if ses != G.user.session, we also force a grab */
function grabUser(ses, force) {
+ _debug("grabUser auth token = " + ses);
if(!ses && isXUL()) {
stash = fetchXULStash();
ses = stash.session.key
@@ -545,6 +546,7 @@
if(!ses) {
ses = cookieManager.read(COOKIE_SES);
/* https cookies don't show up in http servers.. */
+ _debug("cookie auth token = " + ses);
}
if(!ses) return false;
@@ -563,6 +565,7 @@
if(isXUL()) {
dojo.require('openils.XUL');
+ dump('getNewSession in opac_utils.js\n');
openils.XUL.getNewSession(
function(success, authtoken) {
if(success) {
More information about the open-ils-commits
mailing list