From 28113a5d56ff3cb25a8adc99e6375c553a762ad7 Mon Sep 17 00:00:00 2001 From: John Jenkins Date: Thu, 23 Feb 2012 09:47:15 -0800 Subject: [PATCH] Added the username of the requesting user to the audit log for all successful request. The username for user-password requests was always being audited, but it was being placed in the audit_param table. Now, we are adding the username, key 'user', to the audit_extra table for every successful user request. This is dependant on the User object in the request being populated which must have happened for a successful user request. Closes #211 --- src/org/ohmage/request/UserRequest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/org/ohmage/request/UserRequest.java b/src/org/ohmage/request/UserRequest.java index da39a7fc..cc997289 100644 --- a/src/org/ohmage/request/UserRequest.java +++ b/src/org/ohmage/request/UserRequest.java @@ -475,7 +475,15 @@ public final boolean authenticate(AllowNewAccount newAccountsAllowed) { */ @Override public Map getAuditInformation() { - return new HashMap(); + Map result = new HashMap(); + + if(! isFailed()) { + String[] userArray = new String[1]; + userArray[0] = getUser().getUsername(); + result.put(InputKeys.USER, userArray); + } + + return result; } /**************************************************************************