Hi there,
I would like to know, how I can get the usergroups a user is member of.
So far I used
$user = JFactory::getUser();
$usergroups = $user->getAuthorisedGroups();
foreach($usergroups as $usergroup) :
echo $usergroup."<br />";
endforeach;
But this gets all groups, the user is authorised to. This is the output for the superuser:
1
6
8
(1: Public, 6: Manager, 8: Super Users)
The member is infact only member of the group "Super Users", so I would like to have only the output "Super Users". How can I do that?