Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
User event hooks / handler
edited July 2018 in Vanilla 2.0 - 2.8
I would like to know what is the best approach to hook the user events (like before/after user login/register) in plugin for vanilla 2.6. Currently i'm using (ex. entryController_signin_handler) works with Vanilla 2.2. I tried (ex. userModel_afterSignIn_handler) which appears to work with Vanilla 2.6.
Do we have list of hooks for Vanilla 2.6 or version after 2.2?
There is no such list unfortunately.
The best approach is to either examine plugins with similar functionality and examine which hooks they are using, or search the corresponding controller, model & views for
For example, if you want to extend functionality in
/discussionsthat would be
To find view hooks, look out for
$this->render(...)to find out what view a controller method is using (or just search for a translation string or css class contained in the view).
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Thanks @Bleistivt, I'm trying to hook in after register which I did successful using userModel_afterRegister_handler. My concern now is that the session only starts after login not after register. Does anyone tried starting GDN session after register?
In the EntryController are several methods which handle the different registration methods. All of them contain lines similar to this:
So as you can see, the session is started after the registration has successfully been finished. Does that answer your question?
Yes, many thanks @R_J I managed to add event after register in entryController using RegistrationSuccessful.