I am using the following code to check when a user logs in:
public class MyPasswordChecker : IBackOfficeUserPasswordChecker
{
public Task
//get this user by username to obtain the new Id
var userService = ApplicationContext.Current.Services.UserService;
var uUser = userService.GetByUsername(user.UserName);
var result = Task.FromResult(BackOfficeUserPasswordCheckerResult.FallbackToDefaultChecker);
//check for LOCKED out
if (uUser.IsLockedOut)
{
UserLoggingService.Log(uUser.Id, LogEntryAction.LogInFailed, "User Locked Out");
}
else
{
UserLoggingService.Log(uUser.Id, LogEntryAction.LogIn, "Attempted Login");
}
return result;
}
}
I want to log when a user attempts to login but is LOCKED OUT - which my code here can handle.
Also I need to log when a user SUCCESFULLY LOGS IN - but at the stage I only know they are attempting to log in.
I also want to return a friendly message to the user if they are LOCKED OUT so they know to contact admin and not keep trying to login.
It's hard to find any documentation on anything after 7.3 as I know it was changed to IDENTITY.
How to log valid User Logins on version 7.3 and after
I am using the following code to check when a user logs in: public class MyPasswordChecker : IBackOfficeUserPasswordChecker { public Task
I want to log when a user attempts to login but is LOCKED OUT - which my code here can handle.
Also I need to log when a user SUCCESFULLY LOGS IN - but at the stage I only know they are attempting to log in.
I also want to return a friendly message to the user if they are LOCKED OUT so they know to contact admin and not keep trying to login.
It's hard to find any documentation on anything after 7.3 as I know it was changed to IDENTITY.
I am now using Umbraco 7.5 for this project.
Hi, Did you find a solution?
is working on a reply...