Get Logged In User in Application using LDAP

Get Logged In User in Application using LDAP

  

Hi All,

I am using LDAP authentication in my application but i want to know if any admin role user is already logged In in the application or not? because i want to restrict the log In of 2 same role users at same time, only 1 user of admin role should be logged In at one time.

Thanks in advance.

Regards,

Manish Jawla

Hello Manish,

I can add an entity to keep track of the logins and change the login page to create the records in there in your login page. Keep in mind that, if the user closes the browser without logging out you could easily end up with users unable to login, so, a process to "clean the house" is definitely necessary 


Hi Manish,


As Pedro said, there is no way "of out of the box" to control the user sessions, however you can control the login via {User}.[Last_Login] and activity via {Log_Screen}, here an suggestion:


Code Snippet:

SELECT   {User}.[Name], {User}.[Username], {User}.[Last_Login] , max({Log_Screen}.[Instant]), MAX({Log_Screen}.[Session_Id])

FROM {Log_Screen}
  INNER JOIN {User} ON ({User}.[Id] = {Log_Screen}.[User_Id]) 

WHERE ({Log_Screen}.[Instant] < @CountingInstant)
  and ({Log_Screen}.[Instant] > @SessionStartLimit)

GROUP BY {User}.[Name], {User}.[Username], {User}.[Last_Login]
ORDER BY {User}.[Name]


Hope it helps you.