[open-ils-commits] r9539 - trunk/Open-ILS/web/js/dojo/openils

svn at svn.open-ils.org svn at svn.open-ils.org
Thu May 8 17:31:11 EDT 2008


Author: erickson
Date: 2008-05-08 17:31:07 -0400 (Thu, 08 May 2008)
New Revision: 9539

Modified:
   trunk/Open-ILS/web/js/dojo/openils/User.js
Log:
if optional authcookie is set for the user, the login authtoken will be stored at that cookie

Modified: trunk/Open-ILS/web/js/dojo/openils/User.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/User.js	2008-05-08 17:58:24 UTC (rev 9538)
+++ trunk/Open-ILS/web/js/dojo/openils/User.js	2008-05-08 21:31:07 UTC (rev 9539)
@@ -41,6 +41,7 @@
             this.authtime = kwargs.authtime || openils.User.authtime;
             this.login_type = kwargs.login_type;
             this.location = kwargs.location;
+            this.authcookie = kwargs.authcookie || openils.User.authcookie;
 
             if (this.authtoken) this.getBySession();
             else if (this.id && this.authtoken) this.user = this.getById( this.id );
@@ -115,6 +116,10 @@
                     _u.authtime = data.payload.authtime;
 					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);
+                    }
                 }
                 authReq.send();
             }
@@ -151,6 +156,11 @@
             if (!openils.User.authtoken) openils.User.authtoken = _u.authtoken;
             _u.authtime = data.payload.authtime;
             if (!openils.User.authtime) openils.User.authtime = _u.authtime;
+
+            if(_u.authcookie) {
+                dojo.require('dojo.cookie');
+                dojo.cookie(_u.authcookie, _u.authtoken);
+            }
         },
 
     
@@ -241,7 +251,7 @@
 	openils.User.user = null;
 	openils.User.authtoken = null;
 	openils.User.authtime = null;
-
+    openils.User.authcookie = null;
 }
 
 



More information about the open-ils-commits mailing list