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) {
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];
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
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
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;
if(isXUL()) {
dojo.require('openils.XUL');
+ dump('getNewSession in opac_utils.js\n');
openils.XUL.getNewSession(
function(success, authtoken) {
if(success) {