987456123jw
Member
@cheesegrits / @mediaateam
I tried to use this code onAfterProcess in juser plugin. I am not sure that is correct. The main goal is that add user to the group which he create while registration. It is my N-afford to get answer on this question even on professional forum. I am became disappointed.
PHP:
$userid = $formModel->getElementData('user_registration_form___username', true);
$gid = $formModel->getElementData('user_registration_form___companyid', true);
if (!empty($userid) && !empty($gid)) {
JUserHelper::addUserToGroup($userid, $gid);
}
But I am getting error
Access Usergroup Invalid - Joomla!
How I can fix this problem?
I tried to use this code onAfterProcess in juser plugin. I am not sure that is correct. The main goal is that add user to the group which he create while registration. It is my N-afford to get answer on this question even on professional forum. I am became disappointed.
PHP:
$userid = $formModel->getElementData('user_registration_form___username', true);
$gid = $formModel->getElementData('user_registration_form___companyid', true);
if (!empty($userid) && !empty($gid)) {
JUserHelper::addUserToGroup($userid, $gid);
}
But I am getting error
Access Usergroup Invalid - Joomla!
How I can fix this problem?