From abff570a3537087d4f7a01f9d9a41254fda72100 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 23 Jul 2015 14:59:34 -0400 Subject: [PATCH] LP#1468422 API wrapped up; pending more tests Signed-off-by: Bill Erickson --- Open-ILS/src/c-apps/oils_auth.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/c-apps/oils_auth.c b/Open-ILS/src/c-apps/oils_auth.c index 7464df38fb..771df7b152 100644 --- a/Open-ILS/src/c-apps/oils_auth.c +++ b/Open-ILS/src/c-apps/oils_auth.c @@ -227,6 +227,9 @@ static char* oilsAuthBuildInitCache( static int oilsAuthInitUsernameHandler( osrfMethodContext* ctx, const char* username, const char* nonce) { + osrfLogInfo(OSRF_LOG_MARK, + "User logging in with username %s", username); + jsonObject* resp = NULL; // free jsonObject* user_obj = oilsUtilsFetchUserByUsername(username); // free @@ -274,6 +277,9 @@ int oilsAuthInitUsername(osrfMethodContext* ctx) { static int oilsAuthInitBarcodeHandler( osrfMethodContext* ctx, const char* barcode, const char* nonce) { + osrfLogInfo(OSRF_LOG_MARK, + "User logging in with barcode %s", barcode); + jsonObject* resp = NULL; // free jsonObject* user_obj = oilsUtilsFetchUserByBarcode(barcode); // free @@ -335,7 +341,7 @@ static int oilsAuthIdentIsBarcode(const char* identifier) { if (!bc_regex) { // if no regex is set, assume any identifier starting // with a number is a barcode. - bc_regex = strdup("^\\d"); // dupe for later free'ing + bc_regex = strdup("^[[:digit:]]"); // dupe for later free'ing } regex_t regex; @@ -359,6 +365,7 @@ static int oilsAuthIdentIsBarcode(const char* identifier) { } } + regfree(®ex); free(bc_regex); return is_barcode; } @@ -787,6 +794,8 @@ int oilsAuthComplete( osrfMethodContext* ctx ) { ctx->method->name); } + osrfLogInfo(OSRF_LOG_MARK, + "Patron completing authentication with identifer %s", identifier); /* Use __FILE__, harmless_line_number for creating * OILS_EVENT_AUTH_FAILED events (instead of OSRF_LOG_MARK) to avoid -- 2.11.0