Hi- great module!

I'm using invite on a current project for which I'm doing some custom code to have 2 different types of (invited) users register via different registration paths. I'm using Profile2 and Profile2 Registration path to provide the unique registration paths (and profile fields), and some custom forms to generate invites for the different kinds of users (these are basically the standard invite form with some extra fields). The difficulty I've been having is how to catch the users as they accept these invites, and send them to the custom registration path based on what kind of invite (the role of the inviter, basically) it is.

I've written a simple patch which modifies the invite_accept() function slightly so that it will look in the $invite object's data array for a 'regpath' element. If found, invite_accept() calls drupal_goto() with this path instead of the usual one. My custom module code then inserts this regpath element when the invite is initially created, and does a similar hook_menu_alter() trick to set invite_user_register_access as the 'access callback' on the custom registration paths.

This is all working nicely for my use case, but I wondered if this was an opportunity for a feature request on this module to provide more flexibility in general. I'm not sure my patch is worth committing as-is, but perhaps with some extra UI niceties, it could be useful as an added feature? Feedback welcome :)

CommentFileSizeAuthor
per-invite-regpath.patch589 bytesspiderman

Comments

nithinkolekar’s picture

was looking for same feature and IMO when using invite+ profile2 reg path or invite+ auto assign role , it doesn't make sense when actual registration path itself is not protected or in other means, only accessible via invite authentication.

also created an issue in auto assign roleto allow path only for invite authentication.

ckng’s picture

Version: 7.x-2.x-dev » 7.x-4.x-dev
Assigned: spiderman » Unassigned
Status: Active » Closed (duplicate)
Related issues: +#2223399: Allow modules to change the redirect destination and message

Please checkout the newly added hook_invite_accept_alter(). I believe it should be able to achieve what you need.
#2223399: Allow modules to change the redirect destination and message