[open-ils-commits] r13052 - trunk/Open-ILS/web/js/ui (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 4 12:29:17 EDT 2009
Author: erickson
Date: 2009-05-04 12:29:15 -0400 (Mon, 04 May 2009)
New Revision: 13052
Modified:
trunk/Open-ILS/web/js/ui/base.js
Log:
allow the workstation to be passed in via url param for testing/debugging
Modified: trunk/Open-ILS/web/js/ui/base.js
===================================================================
--- trunk/Open-ILS/web/js/ui/base.js 2009-05-04 16:28:50 UTC (rev 13051)
+++ trunk/Open-ILS/web/js/ui/base.js 2009-05-04 16:29:15 UTC (rev 13052)
@@ -8,8 +8,9 @@
dojo.require('openils.Util');
function oilsSetupUser() {
- var authtoken = new openils.CGI().param('ses') || dojo.cookie('ses');
- var workstation = dojo.cookie('oils.ws');
+ var cgi = new openils.CGI();
+ var authtoken = cgi.param('ses') || dojo.cookie('ses');
+ var workstation = cgi.param('ws') || dojo.cookie('ws');
var user;
if(authtoken) user = new openils.User({authtoken:authtoken});
if(!authtoken || openils.Event.parse(user.user)) {
@@ -26,16 +27,21 @@
}
dojo.cookie('ses', authtoken, {path : oilsBasePath});
openils.User.authtoken = authtoken;
- openils.User.workstation = dojo.cookie('oils.ws');
+ openils.User.workstation = workstation;
}
function oilsDoLogin() {
+ var cgi = new openils.CGI();
+ var workstation = cgi.param('ws') || dojo.cookie('ws');
var user = new openils.User();
- user.login({
+ var args = {
username: dojo.byId('oils-login-username').value,
passwd: dojo.byId('oils-login-password').value,
- type: 'staff' // hardcode for now
- });
+ type: 'staff', // hardcode for now
+ };
+ if(workstation)
+ args.workstation = workstation;
+ user.login(args);
dojo.cookie('ses', user.authtoken, {path : oilsBasePath});
location.href = location.href;
return false;
More information about the open-ils-commits
mailing list