[open-ils-commits] r17490 - trunk/Open-ILS/web/js/dojo/openils (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 3 17:08:13 EDT 2010


Author: miker
Date: 2010-09-03 17:08:07 -0400 (Fri, 03 Sep 2010)
New Revision: 17490

Modified:
   trunk/Open-ILS/web/js/dojo/openils/User.js
Log:
make the authcookie param (and openils.User.authcookie) useful

Modified: trunk/Open-ILS/web/js/dojo/openils/User.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/User.js	2010-09-03 20:00:39 UTC (rev 17489)
+++ trunk/Open-ILS/web/js/dojo/openils/User.js	2010-09-03 21:08:07 UTC (rev 17490)
@@ -24,6 +24,7 @@
     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 @@
             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 (!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 (!openils.User.authtime) openils.User.authtime = _u.authtime;
 
             if(_u.authcookie) {
-                dojo.require('dojo.cookie');
                 dojo.cookie(_u.authcookie, _u.authtoken, {path:'/'});
             }
 



More information about the open-ils-commits mailing list