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.
How to hook into an event in theme?
peterlu
New
Hi,
Is there a way to create an addon, so I can hook into event "AfterSignIn"? Is there a code example to do so?
I want to test something like, after user logs in, php runs die('testing') :)
Peter
0
Comments
I've just created a simple and quite useless starter plugin, that you can use to get going.
In that plugin you have to create a new method. If you read through the documentation you might find a pargraph about events. Since "AfterSignIn" is fired in the EntryController, you need to insert a method called "entryController_afterSignIn_handler".
Instead of dumping like you've planned to, I would recommend something less drastic which would require to have phpMyAdmin or similar opened in parallel.
That would write a line to the GDN_UserMeta table where you can look up what happened without interrupting the login process.
$args
are all the EventArguments that are filled before the event is fired. If you want to handle something, those args are most probably of interest for you.Relavent documentation here:
There are a few examples as well.