Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jay 425 posts 652 karma points
    Jul 08, 2019 @ 14:37
    Jay
    0

    Umbraco User Locked Out Event

    Umbraco V7.5.10

    I'm trying to detect the User Locked Out event from the Umbraco Login, was wondering if there's any events I can hooked into similar to

    BackOfficeUserManager.AccountLocked which seems to work with Umbraco V7.7 above

    Thanks

  • David Challener 80 posts 444 karma points c-trib
    Jul 08, 2019 @ 15:02
    David Challener
    0

    Is this package helpful at all https://our.umbraco.com/packages/website-utilities/lockout-membership-provider

    If not, you could do something similar and roll your own membership provider.

    Thanks, David

  • Jay 425 posts 652 karma points
    Jul 08, 2019 @ 15:24
    Jay
    0

    Looking for the User account locked for the Umbraco Back Office (instead of the membership)

  • Jay 425 posts 652 karma points
    Jul 08, 2019 @ 15:37
    Jay
    1

    Found it. If anyone needs to know, I've just hooked it to the OnApplicationStarting with the UserService.

    public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {           
    
            UserService.SavedUser += this.UserServiceSaved;
    
        }
    

    And then

    private void UserServiceSaved(IUserService sender, SaveEventArgs<IUser> e)
        {
            foreach (IUser user in e.SavedEntities)
            {
                //checking if the user is locked out
                if (user.IsLockedOut)
                {
                    //do stuff here like email admin and user
                }
            }
        }
    
Please Sign in or register to post replies

Write your reply to:

Draft