disallow self-check login w/ inactive barcode
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 30 Aug 2010 17:27:38 +0000 (17:27 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 30 Aug 2010 17:27:38 +0000 (17:27 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17390 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index ec4ee8c..6bc4c9e 100644 (file)
@@ -341,7 +341,16 @@ SelfCheckManager.prototype.loginPatron = function(barcode, passwd) {
     );
 
     var evt = openils.Event.parse(this.patron);
-    if(evt) {
+    
+    // verify validity of the card used to log in
+    var inactiveCard = false;
+    if(!evt) {
+        var card = this.patron.cards().filter(
+            function(c) { return (c.barcode() == barcode); })[0];
+        inactiveCard = !openils.Util.isTrue(card.active());
+    }
+
+    if(evt || inactiveCard) {
         this.handleAlert(
             dojo.string.substitute(localeStrings.LOGIN_FAILED, [barcode]),
             false, 'login-failure'