GROUP AUTOJOIN FEATURE - HOW TO??

remigiusz szyndler Posted in Technical Support 5 years ago

Our portal is up and running (YES!!!) I am using the "restrict Group Creation" plugin so incoming people will not fragment into too many groups. However it is somewhat inconvenient for the user and admin ....
Is there a way to Auto-Join users Upon Registration to all Existing Groups ????? it would be such a time saver and an organizational tool for portals that are ran with a focus ....

Replies
us Olivia miller Replied 5 years ago
Polish Remigiusz szyndler Replied 5 years ago

I appreciate every precious minute of your valued time you had spent so far helping my project and I do hope it will be of use to others -- further details are on me -- your roadmap is the spark I needed to dig in .... MUCH APPRECIATED ...

German Michael Zülsdorff Replied 5 years ago

Would that require changes to core components ?

For heavens sake NO! Never touch the Ossn core.

Read the component developing related docs and have a look into the OssnUser.php class instead. The end of the addUser() method is triggering a callback that would pass the user guid of the just created new member.

Your task is to develop a component which is registering a corresponding callback like

ossn_register_callback('user', 'created', 'group_autojoining_function');

and the group_autojoining_function which would loop through the available groups and add the member.

So far for a brief roadmap. Please understand that i don't have the time to go into further details.

Polish Remigiusz szyndler Replied 5 years ago

Would that require changes to core components ??? Or is that doable within the bounds of the OSSN component system ??? I am up for the challenge - I am a DB system designer by trade (financial systems)

German Michael Zülsdorff Replied 5 years ago

Of course there would be a way:
Study the database and find out which relations are making a user a member of a group and add the necessary code to the registration process.