From: miker Date: Fri, 3 Sep 2010 21:08:07 +0000 (+0000) Subject: make the authcookie param (and openils.User.authcookie) useful X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4e744aa6666d40ea58da650978af37db36a0a455;p=evergreen%2Fbjwebb.git make the authcookie param (and openils.User.authcookie) useful git-svn-id: svn://svn.open-ils.org/ILS/trunk@17490 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/User.js b/Open-ILS/web/js/dojo/openils/User.js index 24d67569f..bd91ba878 100644 --- a/Open-ILS/web/js/dojo/openils/User.js +++ b/Open-ILS/web/js/dojo/openils/User.js @@ -24,6 +24,7 @@ if(!dojo._hasResource["openils.User"]) { dojo.require('fieldmapper.Fieldmapper'); dojo.require('fieldmapper.OrgUtils'); dojo.require('openils.Util'); + dojo.require('dojo.cookie'); dojo.requireLocalization("openils.User", "User"); dojo.declare('openils.User', null, { @@ -51,6 +52,7 @@ if(!dojo._hasResource["openils.User"]) { this.authcookie = kwargs.authcookie || openils.User.authcookie; this.permOrgStoreCache = {}; /* permName => permOrgUnitStore map */ + if (this.authcookie) this.authtoken = dojo.cookie(this.authcookie); if (this.id && this.authtoken) this.user = this.getById( this.id ); else if (this.authtoken) this.getBySession(); else if (kwargs.login) this.login(); @@ -148,7 +150,6 @@ if(!dojo._hasResource["openils.User"]) { if (!openils.User.authtime) openils.User.authtime = _u.authtime; _u.getBySession(onComplete); if(_u.authcookie) { - dojo.require('dojo.cookie'); dojo.cookie(_u.authcookie, _u.authtoken, {path:'/'}); } } @@ -192,7 +193,6 @@ if(!dojo._hasResource["openils.User"]) { if (!openils.User.authtime) openils.User.authtime = _u.authtime; if(_u.authcookie) { - dojo.require('dojo.cookie'); dojo.cookie(_u.authcookie, _u.authtoken, {path:'/'}); }