We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    I was just sitting here watching some emails hit my inbox, which are triggered by a plugin on failed user logins. I thought it might be handy to have a plugin that lets me know when MODX blocks a user.

    Then I realized that there are no system events or hooks associated with the act of blocking/unblocking a user.

    It seems like there ought to be. Doesn't it?

    From what I can tell, the actual blocking happens in /core/model/modx/processors/security/login.php, based on logic that involves the number of failed login attempts.

    It would be nice to have a hook there, to write a plugin for.

    Just off the top of my head, I'm guessing the hookset (did I just coin a new word?) would be

    • OnBeforeUserBlock
    • OnBeforeUserUnblock
    • OnUserBlock
    • OnUserUnblock

    Thoughts? Anyone else think this would be a common-sense set of hooks to have available?

      • 3749
      • 24,544 Posts
      A nice feature request, IMO. You could forward the user to a page with suggestions or respond to obvious brute-force hacking attempts.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting