LP#1592565 Log successful authtoken and workstation
authorBill Erickson <berickxx@gmail.com>
Tue, 14 Jun 2016 20:16:08 +0000 (16:16 -0400)
committerJeff Godin <jgodin@tadl.org>
Wed, 15 Jun 2016 15:38:41 +0000 (11:38 -0400)
Recover a previously existing activity log entry that logged the
username, authtoken, and workstation (when available) for successful
logins.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/src/c-apps/oils_auth.c

index fd9b5e7..068e0f1 100644 (file)
@@ -516,6 +516,18 @@ static oilsEvent* oilsAuthHandleLoginOK( jsonObject* userObj, const char* uname,
             jsonObjectGetKey(authEvt, "payload")   // cloned within Event
         );
 
+        osrfLogActivity(OSRF_LOG_MARK,
+            "successful login: username=%s, authtoken=%s, workstation=%s",
+            uname,
+            jsonObjectGetString(
+                jsonObjectGetKeyConst(
+                    jsonObjectGetKeyConst(authEvt, "payload"),
+                    "authtoken"
+                )
+            ),
+            workstation ? workstation : ""
+        );
+
         jsonObjectFree(authEvt);
 
     } else {