[open-ils-commits] r9552 -
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri May 9 21:27:30 EDT 2008
Author: erickson
Date: 2008-05-09 21:27:29 -0400 (Fri, 09 May 2008)
New Revision: 9552
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html
Log:
more work to make the auto-login code happy
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html 2008-05-10 01:26:59 UTC (rev 9551)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html 2008-05-10 01:27:29 UTC (rev 9552)
@@ -11,17 +11,13 @@
<span id='oils-base-header-auto-login'>${_('Auto-login is enabled')}</span>|
<script src='/opac/common/js//Cookies.js'> </script>
<script>
- dojo.require('dojo.cookie');
dojo.require('openils.User');
dojo.require('openils.Event');
- dojo.require('openils.CGI');
-
- var authtoken = dojo.cookie('ses') || new openils.CGI().param('ses');
- var username = '${pylons.config.get("oils_demo_user")}';
- var password = '${pylons.config.get("oils_demo_password")}';
var user;
function dologin() {
+ var username = '${pylons.config.get("oils_demo_user")}';
+ var password = '${pylons.config.get("oils_demo_password")}';
openils.User.authtoken = null;
user = new openils.User();
user.login({
@@ -31,16 +27,13 @@
login:true
});
user.getBySession();
- dojo.cookie('ses', user.authtoken);
+ openils.User.authtoken = user.authtoken;
}
- if(authtoken) {
- user = new openils.User({authtoken:authtoken});
- var res = user.getBySession();
- if(openils.Event.parse(res))
+ if(openils.User.authtoken) {
+ user = new openils.User();
+ if(openils.Event.parse(user.user)) // session timed out
dologin();
- else /* in case we got the ses from the URL */
- dojo.cookie('ses', user.authtoken);
} else {
dologin();
}
More information about the open-ils-commits
mailing list