You are viewing limited content. For full access, please sign in.

Question

Question

Distinct Login Report

asked on March 20, 2020

Does a report exist that shows distinct logins to repositories / forms or does this need to be created manually?

0 0

Replies

replied on March 20, 2020

Any auditing information for the repository first requires adding Audit Trail to the solution. It's reporting UI doesn't have any queries for "distinct", but you could query the backend database to easily get that information.

2 0
replied on March 22, 2020

Forms added the two columns: last_login_time and last_logout_time in the cf_users table since Forms 10.4.1, these two columns will be updated when the user login and logout. You can create a session history table to get the logs for login/logout similar as following:

--create sessionhistory table


SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[SessionsHistory](

[LogID] [int] IDENTITY(1,1),

[UserID] [int] NULL,

[SessionID] [uniqueidentifier] NULL,

[LoginTime] [datetime2] NULL,

[LogoutTime] [datetime2] NULL

) ON [PRIMARY]

GO

--create trigger on cf_users table

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

IF OBJECT_ID ('[dbo].[SessionHistoryTrigger]', 'TR') IS NOT NULL

DROP TRIGGER [dbo].[SessionHistoryTrigger]

GO

CREATE TRIGGER [dbo].[SessionHistoryTrigger]

ON [dbo].[cf_users]

AFTER UPDATE

AS

BEGIN

SET NOCOUNT ON;

--audit log for login

IF UPDATE(last_login_time)

BEGIN

INSERT into [dbo].[SessionsHistory](

UserID,

SessionID,

LoginTime

)

select u.user_id, u.auth_code,u.last_login_time from

[dbo].[cf_users] u

join

inserted i on u.user_id=i.user_id

join

deleted d on u.user_id=d.user_id

End

--audit log for logout

IF UPDATE(last_logout_time)

BEGIN

INSERT into [dbo].[SessionsHistory](

UserID,

SessionID,

LogoutTime

)

select u.user_id, u.auth_code,u.last_logout_time from

[dbo].[cf_users] u

join

inserted i on u.user_id=i.user_id

join

deleted d on u.user_id=d.user_id

End

END

 

1 0
replied on April 28, 2020

We tried to run the code against the sandbox database, but the trigger won’t compile because the columns last_login_time, auth_code, and last_logout_time don’t exist within the cf_users table.  We are on Forms 10.3.0.975.  Is there another way to accomplish this?  I did notice a Last Login / Logout field in the Admin Console, is this a possibility?

0 0
replied on May 6, 2020

The last_login_time and last_logout_time are added in the cf_users table since Forms 10.4.1. You can't add such trigger with Forms 10.3.0. Please uprade to a version that support the two columns.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.