"OPEN_CIRCULATION_EXISTS" : "Item ${0} is already checked out to another user",
"GENERIC_CIRC_FAILURE" : "Unable to check out item ${0}. Please see staff.",
"LOGIN_FAILED" : "Login for ${0} failed",
+ "LOGIN_BARCODE_DOUBLE" : "Your PIN is needed.",
"UNKNOWN_ERROR" : "An unhandled exception occurred with error code ${0}",
"MAX_RENEWALS" : "No more renewals allowed for item ${0}",
"ITEM_NOT_CATALOGED" : "Item ${0} was not found in the system. Try re-scanning the item.",
this.staff = null;
this.workstation = null;
this.authtoken = null;
+ this.fail_count = 0;
this.patron = null;
this.patronBarcodeRegex = null;
var txtBox = (dojo.byId('step2').style.display=='none') ? 'patron-login-username' : 'patron-login-password';
try{var a=dojo.byId(txtBox);a.focus();a.select();}catch(e){}
+ SelfCheckManager.fail_count = 0;
}
/**
if(res == 0) {
// user-not-found results in login failure
- this.handleAlert(
- dojo.string.substitute(localeStrings.LOGIN_FAILED, [barcode || usrname]),
- false, 'login-failure'
- );
- this.drawLoginPage();
- openils.Util.show('back_to_login');
+ this.fail_count++;
+ // Double-Scan of Barcode
+ if (dojo.byId('patron-login-username').value == dojo.byId('patron-login-password').value) {
+ dojo.byId('patron-login-password').value = '';
+ dojo.byId('patron-login-password').focus();
+ if (this.fail_count > 0) {
+ // Barcode and PIN are the same, but fails login? That means double scan
+ this.handleAlert(localeStrings.LOGIN_BARCODE_DOUBLE, false, 'login-failure');
+ openils.Util.show('back_to_login');
+ }
+ } else {
+ this.handleAlert(
+ dojo.string.substitute(localeStrings.LOGIN_FAILED, [barcode || usrname]),
+ false, 'login-failure'
+ );
+ this.drawLoginPage();
+ openils.Util.show('back_to_login');
+ }
return;
}
//}
function cancelLogin() {
+ SelfCheckManager.fail_count = 0;
dojo.byId('oils-selfck-status-div').innerHTML = '';
dojo.byId('oils-selfck-status-div2').innerHTML = '';
dojo.byId('oils-selfck-status-div3').innerHTML = '';