1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hooking into actions not handled by CodeEvent

Discussion in 'XenForo Development Discussions' started by Naatan, Jan 9, 2012.

  1. Naatan

    Naatan Well-Known Member

    My current use-case is I want to attach some logic to the code right after someone logs in. From what I've found there's no clear way of determining this based on the events fired through CodeEvent. I can think of several ways to achieve this anyway, but I'd like to know if there is a way XenForo can support hooks like this without getting into hacking too much (at all)?

    Any tips?

  2. digitalpoint

    digitalpoint Well-Known Member

    You should be able to use the controller_pre_dispatch event listener and have it watch for the "login" action firing on the "login" controller. That would work for someone actually logging in. Now for someone who has been gone for awhile, but automatically logs in via cookies, that wouldn't work... so depends on what *exactly* you are trying to do.

Share This Page