From 8d6aef9315e10b280927c3f25d92d32a410b6ab8 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 8 May 2008 17:13:02 +0000 Subject: [PATCH] Merged revisions 9534-9535 via svnmerge from svn://svn.open-ils.org/ILS/trunk ........ r9534 | dbs | 2008-05-08 12:16:48 -0400 (Thu, 08 May 2008) | 2 lines Patch from Craig Ricciuto to care of XML i18n business in opac.xul ........ r9535 | erickson | 2008-05-08 13:12:40 -0400 (Thu, 08 May 2008) | 1 line created a fully synchronous version of the login method ........ git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9536 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/User.js | 35 ++++++++++++++++++++++++++- Open-ILS/web/opac/locale/en-US/lang.dtd | 17 +++++++++++++ Open-ILS/xul/staff_client/server/cat/opac.xul | 22 ++++++++--------- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/User.js b/Open-ILS/web/js/dojo/openils/User.js index 2bc60dd94c..9b5e2a90a9 100644 --- a/Open-ILS/web/js/dojo/openils/User.js +++ b/Open-ILS/web/js/dojo/openils/User.js @@ -86,7 +86,7 @@ if(!dojo._hasResource["openils.User"]) { /** * Logs in, sets the authtoken/authtime vars, and fetches the logged in user */ - login : function(args, onComplete) { + login_async : function(args, onComplete) { var _u = this; if (!args) args = {}; @@ -101,6 +101,7 @@ if(!dojo._hasResource["openils.User"]) { var seed = r.recv().content(); alert(seed); var loginInfo = { + username : args.username, password : hex_md5(seed + hex_md5(args.passwd)), type : args.type, org : args.location, @@ -120,6 +121,38 @@ if(!dojo._hasResource["openils.User"]) { initReq.send(); }, + + login : function(args) { + var _u = this; + if (!args) args = {}; + if (!args.username) args.username = _u.username; + if (!args.passwd) args.passwd = _u.passwd; + if (!args.type) args.type = _u.login_type; + if (!args.location) args.location = _u.location; + + var seed = fieldmapper.standardRequest( + ['open-ils.auth', 'open-ils.auth.authenticate.init'], + [args.username] + ); + + var loginInfo = { + username : args.username, + password : hex_md5(seed + hex_md5(args.passwd)), + type : args.type, + org : args.location, + }; + + var data = fieldmapper.standardRequest( + ['open-ils.auth', 'open-ils.auth.authenticate.complete'], + [loginInfo] + ); + + _u.authtoken = data.payload.authtoken; + if (!openils.User.authtoken) openils.User.authtoken = _u.authtoken; + _u.authtime = data.payload.authtime; + if (!openils.User.authtime) openils.User.authtime = _u.authtime; + }, + /** * Returns a list of the "highest" org units where the user diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index ca15947bff..c9dd4484b5 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1896,3 +1896,20 @@ + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/xul/staff_client/server/cat/opac.xul b/Open-ILS/xul/staff_client/server/cat/opac.xul index 3176fe8b42..e282de0125 100644 --- a/Open-ILS/xul/staff_client/server/cat/opac.xul +++ b/Open-ILS/xul/staff_client/server/cat/opac.xul @@ -10,7 +10,7 @@ + ]> @@ -331,19 +331,19 @@