[open-ils-commits] r9537 -
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 8 13:50:40 EDT 2008
Author: erickson
Date: 2008-05-08 13:50:37 -0400 (Thu, 08 May 2008)
New Revision: 9537
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html
Log:
now handling autologin from within the JS instead of the python libs
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-08 17:13:02 UTC (rev 9536)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html 2008-05-08 17:50:37 UTC (rev 9537)
@@ -9,8 +9,42 @@
%>
% if auto_login:
<span id='oils-base-header-auto-login'>${_('Auto-login is enabled')}</span>|
+ <script src='/opac/common/js//Cookies.js'> </script>
+ <script>
+ dojo.require('openils.User');
+ dojo.require('openils.Event');
+ var authtoken = '${c.oils.core.authtoken.value}';
+ var username = '${pylons.config.get("oils_demo_user")}';
+ var password = '${pylons.config.get("oils_demo_password")}';
+ var user;
+
+ function dologin() {
+ openils.User.authtoken = null;
+ user = new openils.User();
+ user.login({
+ login_type:'staff',
+ username:username,
+ passwd:password,
+ login:true
+ });
+ user.getBySession();
+ dojo.require('dojo.cookie');
+ dojo.cookie('ses', user.authtoken, {expires:1});
+ }
+
+ if(authtoken) {
+ user = new openils.User({authtoken:authtoken});
+ var res = user.getBySession();
+ if(openils.Event.parse(res))
+ dologin();
+ } else {
+ dologin();
+ }
+ </script>
+ <span id='oils-base-header-user-info'> </span>
+ <script>
+ dojo.byId('oils-base-header-user-info').appendChild(
+ document.createTextNode(user.user.usrname()));
+ </script>
% endif
- <span id='oils-base-header-user-info'>
- ${c.oils.core.user.value.usrname()} / ${c.oils.core.workstation.value.name()}
- </span>
</div>
More information about the open-ils-commits
mailing list