Forums | Mahara Community
Developers
/
Adding users to group programmatically
11 July 2020, 2:35
I realise I will probably have to build this myself, however always worth asking!
The requirement is when a user logs in to add them to a specific group based on a user attribute having certain values (in the specific example, we want to add users who have an email address in our company domain to an internal staff group).
Has anyone seen a plugin that might do that (or might be close so modifiable) ?
thanks
Julian
29 November 2020, 10:40
Hi Julian,
There is the option to auto-add people who register new on the site to a group. However, that would add everybody to the group. You could adjust the functionality to only add people with certain attributes. Alternatively, if that were a possibility with your setup, you could add all your employees into a separate institution and have everybody else in a different institution and then change Mahara so that the group setting 'Auto-add to group' only applies to institution members and not everybody who joins the site in another institution. That feature can even go back into core if you'd like to contribute it to the community.
Another alternative is to upload accounts for all your staff to Mahara via CSV and add them to the group via CSV.
Best,
Kristina