for barcode not set up
This patch was written by Bob Wicksall and posted to launchpad. I've
tested on my own server and packaged it for review here.
The fix allows a patron to log into the self-check interface with either
a barcode or a user name.
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Revert "LP#
1528647 Self-check only accepts user name value if regex"
Terran reports this not working as expected.
This reverts commit
0eb3a73c2fba4f609c0dab015a843a550e03516e.
LP#
1528647 Self-check only accepts user name value if regex
for barcode not set up
This fix allows a patron to log into the self-check interface with either
a barcode or a user name.
Written by: Bob Wicksall <bwicksall@pls-net.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
LP#
1528647 Self-check only accepts user name value if regex for barcode
not set up
The original fix only worked if password was not required for self-check.
This fix allows it to work when password is required as well.
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
if (!args.passwd) args.passwd = _u.passwd;
if (!args.agent) args.agent = _u.login_agent;
if (!args.type) args.type = _u.type;
-
- var initReq = OpenSRF.CachedClientSession('open-ils.auth').request('open-ils.auth.authenticate.init', args.username);
+
+ if (args.username) {
+ var initReq = OpenSRF.CachedClientSession('open-ils.auth').request('open-ils.auth.authenticate.init', args.username);
+ } else {
+ var initReq = OpenSRF.CachedClientSession('open-ils.auth').request('open-ils.auth.authenticate.init', args.barcode);
+ }
initReq.oncomplete = function(r) {
var seed = r.recv().content();
}
if(settings[SET_BARCODE_REGEX]) {
- this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value)
+ this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value);
} else {
- this.patronBarcodeRegex = newRegExp(/^\d/);
+ this.patronBarcodeRegex = new RegExp(/^\d/);
// this assumes barcodes start with digits
}