I would include it in auth. It should be easy to implement as follows:
The inviter creates a new record for the invitee and triggers a request reset
password request with an optional custom message.
You do not need an extra table for invitations. You may need an extra field for
auth_user to store the the id of the person who created the record (invitation)
if not self.
On Jan 21, 2012, at 11:40 PM, Bruno Rocha wrote:
> Hi,
>
> I am planning to develop an "registration requires invitation" to my custom
> Auth.
>
> auth.settings.registration_requires_invitation = True
> auth.messages.invitation = \
> 'HI, You have been invited to join XXXXX, click on the link
> http://' + self.db.request.env.http_host + \
> self.db.CURL('default', 'user', args=['invite']) + \
> '?invitationkey=%(key)s to register'
>
> The flow is:
>
> Registered user goes to /default/user/invite, so the user puts the e-mail of
> a friend and auth does:
>
> Store an invitation key in to auth_invitation table (user_id_who_invited,
> invitation_key, invited_id, signature)
> Send an email to the invited user with a link to the register page with
> ?invitationkey=KFDNJFLDKNFJDLNFJDNF&*9340540985
> Invited user clicks in the link, auth checks if invitation ID exists, so user
> are redirected to the register page, if sucess invitation_key is set to NULL,
> invited_id is set to the new user id.
> The user who invited receives an confirmation email "The user you have
> invited registered!"
> Auth will have a function bulk_invitation(list_of_emails) so developers can
> use to send mass invitation
>
> Have somebody already implemented this? can share?
>
> what are the chances to include it in Auth?
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>
> --
> mail from:GoogleGroups "web2py-developers" mailing list
> make speech: [email protected]
> unsubscribe: [email protected]
> details : http://groups.google.com/group/web2py-developers
> the project: http://code.google.com/p/web2py/
> official : http://www.web2py.com/