MyBB Community Forums

Full Version: Hook for successful log in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there, I'm relatively new here, and posted an introduction some days ago, which is here:

I'm writing a plugin that's supposed to identify and manage users who have gone inactive (stopped visiting). One of the things it should do is to change their status back to active upon successfully logging back in. While looking into the hooks that I may use, there are at least three alternatives:

  1. member_do_login_end
  2. member_login_end
  3. datahandler_login_complete_end

I'm not sure which one to use, or whether there is a better one. Could you help? Thank you.

P.S. I'll appreciate if you could explain the difference between them.
I am still waiting for a reply.
Use datahandler_login_complete_end. It's placed deep into the loginhandler->complete_login() function, which may be used by other plugins as well. Another advantage is that you don't even need to check for variables, when you hook into the function you are certain the user has logged in successfully.
Thank you for your help.