From: erickson Date: Mon, 31 Jul 2006 14:43:24 +0000 (+0000) Subject: added some friendlier messages for bad logins X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a9594cebc774609a8890b5432ca00f2cf6690d74;p=Evergreen.git added some friendlier messages for bad logins git-svn-id: svn://svn.open-ils.org/ILS/trunk@5179 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index d378105284..55a388c411 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -582,9 +582,29 @@ function doLogin(suppressEvents) { var auth_request = new Request( LOGIN_COMPLETE, args ); + auth_request.request.alertEvent = false; auth_request.send(true); var auth_result = auth_request.result(); - if(!auth_result) return null; + + if(!auth_result) { + alertId('patron_login_failed'); + return null; + } + + if( checkILSEvent(auth_result) ) { + + if( auth_result.textcode == 'PATRON_CARD_INACTIVE' ) { + alertId('patron_card_inactive_alert'); + return; + } + + if( auth_result.textcode == 'LOGIN_FAILED' || + auth_result.textcode == 'PERM_FAILURE' ) { + alertId('patron_login_failed'); + return; + } + } + AUTHTIME = parseInt(auth_result.payload.authtime); var u = grabUser(auth_result.payload.authtoken, true); @@ -887,4 +907,5 @@ function parseForm(form) { } -function isTrue(x) { return ( x && x != "0" && x != 'f' ); } +function isTrue(x) { return ( x && x != "0" && !x.match(/^f$/i) ); } + diff --git a/Open-ILS/web/opac/skin/default/xml/common/login.xml b/Open-ILS/web/opac/skin/default/xml/common/login.xml index c391f26b57..1a628892fb 100644 --- a/Open-ILS/web/opac/skin/default/xml/common/login.xml +++ b/Open-ILS/web/opac/skin/default/xml/common/login.xml @@ -100,6 +100,15 @@ &common.password_criteria; + + The barcode used to login is marked as inactive. Please contact your local library. + + + + Login failed. The username or password provided was not valid. + Make sure Caps-Lock is off and try again or contact your local library. + +