Hey Guys,
in my actual project, there are three types of users in the frontend (seperated by different user-groups in the manager): the companies, the trainees and the admins.
Normaly, a trainee-account will not become an company-account in a real world scenario, but for testing, I've done this exactly.
I have a snippet, whichs gets the usertype via $user->isMember($usergroup) and returns the correct usertype by checking if the user is member in one of the three usergroups.
My test was the following:
At the start, I have got a user in the usergroup "trainee" - and my snippet says that he/she is a trainee.
Correct.
Now, I have deleted that membership of the trainee-usergroup for that user in the manager and saved. My (uncached) snippet says, that he/she is still a trainee.
Incorrect.
After that I have added the User to the usergroup "company", but after saving and reloading, my snippet gets the information from $user->isMember('trainee') back, that the user is still a trainee - not a company.
Defenetly incorrect.
I've also tried to clear the cache and refresh the rights (Menu > Security), but nothing changes. And a logout in the frontend + new login in the frontend also doesn't change anything.
Is there another way to check if a user in a certain usergroup? Or do I have to get that done with a direct SQL-Query by myself?
Cheers and thanks!

Greetings from Germany
Jens
[ed. note: vamporio last edited this post 13 years, 7 months ago.]