From f8f56b994fd8e4a342439700bc2887d74963e425 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 11 Nov 2008 00:47:26 +0000 Subject: [PATCH] interface for verifying login credentials git-svn-id: svn://svn.open-ils.org/ILS/trunk@11125 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 8 ++ .../chrome/content/auth/verify_credentials.js | 57 ++++++++++++++ .../content/auth/verify_credentials.xul | 78 +++++++++++++++++++ .../chrome/content/main/constants.js | 2 + .../staff_client/chrome/content/main/menu.js | 10 +++ .../chrome/content/main/menu_frame_menus.xul | 2 + .../chrome/locale/en-US/offline.properties | 3 + .../xul/staff_client/chrome/skin/global.css | 3 + 8 files changed, 163 insertions(+) create mode 100644 Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js create mode 100644 Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index ed087f1a99..531a2e0a58 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -39,6 +39,7 @@ + @@ -62,6 +63,7 @@ + @@ -178,6 +180,10 @@ + + + + @@ -692,6 +698,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js b/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js new file mode 100644 index 0000000000..569d0df5ca --- /dev/null +++ b/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js @@ -0,0 +1,57 @@ +function verify_init() { + try { + offlineStrings = document.getElementById('offlineStrings'); + + if (typeof JSAN == 'undefined') { + throw( + offlineStrings.getString('common.jsan.missing') + ); + } + + JSAN.errorLevel = "die"; // none, warn, or die + JSAN.addRepository('..'); + + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve(); + XML_HTTP_SERVER = data.server_unadorned; + + JSAN.use('util.network'); var net = new util.network(); + document.getElementById('cmd_verify').addEventListener( + 'command', + function() { + try { + var req = net.simple_request( + 'AUTH_VERIFY_CREDENTIALS', + [ + ses(), + document.getElementById('barcode_prompt').value, + document.getElementById('name_prompt').value, + hex_md5( document.getElementById('password_prompt').value ) + ] + ); + + if (typeof req.ilsevent != 'undefined') { throw(req); } + + var msg_area = document.getElementById('messages'); + var desc = document.createElement('description'); msg_area.insertBefore(desc, msg_area.firstChild); + desc.setAttribute('class', String(req) == '1' ? 'success_text' : 'failure_text'); + var text = document.createTextNode( + String(req) == '1' ? + offlineStrings.getString('menu.cmd_verify_credentials.correct_credentials') : + offlineStrings.getString('menu.cmd_verify_credentials.incorrect_credentials') + ); + desc.appendChild(text); + + } catch(E) { + alert(E); + } + document.getElementById('name_prompt').focus(); + }, + false + ); + + document.getElementById('name_prompt').focus(); + + } catch(E) { + alert(E); + } +} diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul b/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul new file mode 100644 index 0000000000..3af412bf25 --- /dev/null +++ b/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + +