LP#1468422 API wrapped up; pending more tests
authorBill Erickson <berickxx@gmail.com>
Thu, 23 Jul 2015 18:59:34 +0000 (14:59 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 23 Nov 2015 16:17:05 +0000 (11:17 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/c-apps/oils_auth.c

index 7464df3..771df7b 100644 (file)
@@ -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(&regex);
     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