We are looking for an easy way to add a newly registered user to a specific user group (via addon php code hooked into our existing register controller addon which provides a custom landing page redirect after registration).
I am familiar with using the admin stuff to edit a user profile and assign secondary user groups (this is what we want to do via configurable php code @ registration time). The \Xf\Entity\User object has a handy RemoveUserFromGroup but I have not been able to find any obvious corresponding method to add a user to a secondary group.
The semi-non-obvious approach would be to extend the User object and add our own AddUserToGroup method but this seems such an obvious feature that we think we are overlooking the obvious.
ideas?
I am familiar with using the admin stuff to edit a user profile and assign secondary user groups (this is what we want to do via configurable php code @ registration time). The \Xf\Entity\User object has a handy RemoveUserFromGroup but I have not been able to find any obvious corresponding method to add a user to a secondary group.
The semi-non-obvious approach would be to extend the User object and add our own AddUserToGroup method but this seems such an obvious feature that we think we are overlooking the obvious.
ideas?