[open-ils-commits] r18106 - in trunk/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:49:11 EDT 2010
Author: phasefx
Date: 2010-09-29 16:49:05 -0400 (Wed, 29 Sep 2010)
New Revision: 18106
Modified:
trunk/Open-ILS/web/js/dojo/openils/XUL.js
trunk/Open-ILS/web/js/ui/base.js
trunk/Open-ILS/web/opac/common/js/opac_utils.js
Log:
Fix overzealous prompting for auth credentials, and some debug lines
Modified: trunk/Open-ILS/web/js/dojo/openils/XUL.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/XUL.js 2010-09-29 20:16:41 UTC (rev 18105)
+++ trunk/Open-ILS/web/js/dojo/openils/XUL.js 2010-09-29 20:49:05 UTC (rev 18106)
@@ -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: trunk/Open-ILS/web/js/ui/base.js
===================================================================
--- trunk/Open-ILS/web/js/ui/base.js 2010-09-29 20:16:41 UTC (rev 18105)
+++ trunk/Open-ILS/web/js/ui/base.js 2010-09-29 20:49:05 UTC (rev 18106)
@@ -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: trunk/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/opac_utils.js 2010-09-29 20:16:41 UTC (rev 18105)
+++ trunk/Open-ILS/web/opac/common/js/opac_utils.js 2010-09-29 20:49:05 UTC (rev 18106)
@@ -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