diff --git a/SecureCore/SQL Scripts/User Auth Template.sql b/SecureCore/SQL Scripts/User Auth Template.sql index f2ce357..bb6efe3 100644 --- a/SecureCore/SQL Scripts/User Auth Template.sql +++ b/SecureCore/SQL Scripts/User Auth Template.sql @@ -232,7 +232,7 @@ BEGIN SET @Description = FORMATMESSAGE('"%s" logged in', @UserName) - INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, @Description, SYSDATETIME(), 'SP_LoginUser') + INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, @Description, SYSDATETIME(), CONCAT('SP_', OBJECT_NAME(@@PROCID))) COMMIT TRANSACTION; END TRY @@ -288,7 +288,7 @@ BEGIN DELETE FROM [Session] WHERE [Session ID] = @SessionID IF @EventID IS NOT NULL - INSERT INTO ActivityLog ([Event Description], [Timestamp], [Component], [Event ID]) VALUES (FORMATMESSAGE('User "%s" has logged out', @UserName), SYSDATETIME(), 'SP_LogoutUser', @EventID) + INSERT INTO ActivityLog ([Event Description], [Timestamp], [Component], [Event ID]) VALUES (FORMATMESSAGE('User "%s" has logged out', @UserName), SYSDATETIME(), CONCAT('SP_', OBJECT_NAME(@@PROCID)), @EventID) COMMIT TRANSACTION; @@ -351,7 +351,7 @@ BEGIN SET @Description = FORMATMESSAGE('"%s" requested a password reset', @UserName) - INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, @Description, SYSDATETIME(), 'SP_LogPasswordResetRequest') + INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, @Description, SYSDATETIME(), CONCAT('SP_', OBJECT_NAME(@@PROCID))) COMMIT TRANSACTION; END TRY @@ -429,7 +429,7 @@ BEGIN SELECT @SessionID = SCOPE_IDENTITY() - INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, FORMATMESSAGE('Registered user "%s".', @UserName), SYSDATETIME(), 'SP_RegisterUser') + INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, FORMATMESSAGE('Registered user "%s".', @UserName), SYSDATETIME(), CONCAT('SP_', OBJECT_NAME(@@PROCID))) SELECT @UserID AS UserKey @@ -496,7 +496,7 @@ BEGIN DELETE FROM [Session] WHERE [User ID] = @UserID - INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, FORMATMESSAGE('User "%s" has had their password reset.', @UserName), SYSDATETIME(), 'SP_ResetPassword') + INSERT INTO [ActivityLog] ([Event ID], [Event Description], [Timestamp], [Component]) VALUES (@EventID, FORMATMESSAGE('User "%s" has had their password reset.', @UserName), SYSDATETIME(), CONCAT('SP_', OBJECT_NAME(@@PROCID))) COMMIT TRANSACTION; @@ -556,7 +556,7 @@ BEGIN DELETE FROM [Session] WHERE [Session ID] = @SessionID IF @EventID IS NOT NULL - INSERT INTO [ActivityLog] ([Event Description], [Timestamp], [Event ID], [Component]) VALUES ('Session token has expired', SYSDATETIME(), @EventID, 'SP_ValidateSessionToken') + INSERT INTO [ActivityLog] ([Event Description], [Timestamp], [Event ID], [Component]) VALUES ('Session token has expired', SYSDATETIME(), @EventID, CONCAT('SP_', OBJECT_NAME(@@PROCID))) END END COMMIT TRANSACTION;