Member groups

knme
Forums
Hi we've just started to experiment with the platform, looks quite smart and well. One thing we wonder about: is it somehow possible to clone or set up user groups, either by edit or group select (i.e. all members with @maildomain.comn automatically belongs to a group). Or, is there some way to clone the member add process from one course to another? Having to add everyone manually is laborious and would have been nice to avoid. Thanks!
Profile picture for user James Aparicio
James Aparicio

Hi knme,

Hi knme,

Sure, you can easily implement hook_user_insert/hook_user_presave/hook_user_update, check the mail domain, and add them to specific groups. You can add a field "domain" to the groups and check what group/groups have that domain and add the user to them.

BR

knme

Thanks very much! I'll make a

Thanks very much! I'll make a note of that!
knme

On the second question

is there a way to clone number members added to one course/lesson to another? Thanks
Profile picture for user James Aparicio
James Aparicio

Hi knme,

Hi knme,

Didnt understand the question. Could you give more details?

Best regards

knme

Ok

Ok you set up a class, course, or a lesson. This creates and organic group to which you add members. I was thinking about a way to replicate that context, i.e. members of an organic group, from one entity to another. Thus avoid having to re-add potentially 100ths of people to a new course/lesson. Hopefully this was clearer? :) Would a group/role with subsequent permissions be the way to go? Thanks
Profile picture for user James Aparicio
James Aparicio

Hi knme,

Hi knme,

There is a module called replicate.

This allows you to duplicate a node. 

You can implement the hook_replicate_entity, check the og memberships in the original node and add them to the new one.

BR