9

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.

4

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!

  • Thanks. I will try. Should I return false for not to activate the member in case of unapproval? – Malaiselvan Jan 15 '16 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. :) – Simba Jul 13 '16 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.