I want to perform some operations on newly registered user when he hits the register button on register form and before he gets the system message about the activation mail(if useractivation setting is ON)
For that i have modified the file components/com_user/controller.php
In register_save method of the class JController, I have changed the original PHP code
if ( !$user->save() )
{
JError::raiseWarning('', JText::_( $user->getError()));
$this->register();
return false;
}
into
if ( !$user->save() )
{
JError::raiseWarning('', JText::_( $user->getError()));
$this->register();
return false;
}
include('custom_operations.php');
In custom_operations.php file, i have used $user variable to access username and email of newly registered user but following code gives me 0 value
$user->get('id');
How can i access the userid of that newly registered user? Is there any other way to execute custom_operations.php file(I have also put an extra field in register form which is essential in this file)?
Please guide
you may create a joomla plugin with the type of user and be able to override the methods: onUserAfterSave and onUserBeforeSave methods. 🙂