hi,
I have created MyAuth(Auth)
I have override the method register() with
if self.environment.response.mode == 'buyer':
onaccept = registerBuyer
return super(EnvoyAuth, self).register(next, onvalidation, onaccept,
log)
when users have been successfully register, my own registerBuyer is
called.
def registerBuyer(form):
from registerBuyer I can access form.vars.id
I want to call:
group_id = auth.add_group( 'buyer', 'main group')
auth.add_membership(group_id, form.vars.id)
Two questions:
1. is this the right approach to implement several different
registration forms (one for each type of user). User will be able to
register for multiple services but I don't want them all to have to
fill in all the user fields (I need more info from buyers than from
general users for example).
2. if my approach is fine then how do I access the auth instance that
was set-up in db.py with auth=EnvoyAuth(globals(),db)
thanks
Carl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---