8

I am just referring the Joomla User plugin events in the URL https://docs.joomla.org/Plugin/Events/User/en

onUserLogin onUserAuthenticate onUserBeforeSave 

Just wondering which one will help me to do something only when they validating their email address from the Email activation link?

Note: During the time of Email activation I have to connect to a SOAP server and validate few stuffs and then only allow him to activate the account.

1 Answer 1

3

you can do it this way: You create a user plugin (NOT authentication plugin, this one is separate), i called mine testwise "checkmail". In that plugin put the onUserBeforeSave callback, in wich you can check if the account is getting activated like this:

class PlgUserCheckmail extends JPlugin { /** * Application object * * @var JApplicationCms * @since 3.2 */ protected $app; /** * Database object * * @var JDatabaseDriver * @since 3.2 */ protected $db; public function onUserBeforeSave($oldUser, $isNew, $newUser) { if(!$isNew) { if(isset($oldUser['activation']) && !empty($oldUser['activation']) && isset($newUser['activation']) && empty($newUser['activation'])) { // These commands in here are only triggered if the user is activating his account } } } } 

Hope this helps =)

[edit]: Ah, i almost forgot: This plugin goes inside the plugins/user directory!

2
  • Thanks. I will try. Should I return false for not to activate the member in case of unapproval? Commented Jan 15, 2016 at 17:57
  • Deleted my previous comment that this doesn't work -- I had a stupid bug. It does work, and it works great. Thanks for the tip. :) Commented Jul 13, 2016 at 11:39

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.