Hey all!
I'm kind of hoping someone might be interested in helping me out with this or atleast offering some ideas because even shooting the breeze is helpful here. I want to have users assigned to a group upon registration. The easy part is that the groups are already defined in the data base(i'll create them myself) so it woluld not have to be dynamic in that sense. I would imagine the code would go something like this:
Get group name/GUID from drop down menu at registration
Send invite from GUID to User
Accept Invite
...done
They would only need to be registered to one group and I want to prevent the users from registering for another group because basically I'm trying to have users register by school and have their school group be the only group they have access to.
You can see my work so far at www.youhaveihave.com
Thanks!!
-Ray-
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- PLai@plai
PLai - 0 likes
- The registration form is implemented by the "account/forms/register" view. You would add your new UI elements to views/default/account/forms/register.php.
- You need some way to carry the group selected through the registration process.
- Note that a new user is disabled until validated; I assume that you are using the uservalidationbyemail plugin.
- It may be confusing to the user that there's an validation e-mail and then an invite to join a group that he has already selected during registration.
- You would need to disable the various group management actions (e.g. add to group).
- Let the group for a new user be specified by say the "school_group" parameter.
- Register a plugin hook for the "email/confirm" action. If "school_group" is missing, redirect the user to a page where he can select his school. The email confirmation request is then resubmitted with school_group. (We can talk about how to do a plugin hook for action if you are not familiar with it.)
- If school_group is present, than upon successful validation, the plugin hook would cause the new user to be added to the group (basically a ElggGroup::join() call).
- Ray@Chronicdiving
Ray - 0 likes
- PLai@plai
PLai - 0 likes
You must log in to post replies.Hi Ray,
Here are some thoughts if you let the user select his school during registration:
I think you may have a smoother process if you let the user select his school during validation instead. Here's what I would try:
-- Patrick
WOW...i just wrote a HUGE paragraph and forgot to click submit...walked away, came back an hour later, clicked submit and the error box pops up sayin the page expired and then it wouldn't let me get my comment back...UGH!
anyways, so the gist is this...on the site now i have a field in registration where they can chose their school from a drop down menu but it's only a tag field...can i harness that power somehow and maybe do something like:
after email confirmation
get infofield_school
find the group with the same name(i'd manually create the schools(i.e. groups) in the database that I want)
Autoinvite/autoaccept
What cha think?
Thanks!
-Ray-
The "email/confirm" action triggers an 'enable' event when the confirmation is verified, so it is simpler than I thought. I don't know how you pass 'infofield_school' around, but something like the following would work: