Assigning User To Joomla User Group
To assign a user into a specific Joomla user group, you may use the codes below:
require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php'); $user = ES::user($id); $user->assign(int $id, int $groupId);
$id(Required) - You'll need to provide the user id.
$groupId(Required) - You'll need to provide the group id to be assigned to.
public function assignToGroup($id , $gid)