Thanks for the answers. Your suggestion for one single form worked well. As 
for the verification issue, it didn't happen when I used the default user() 
action (that is, it only happens when I overwrite the register() action). 
Perhaps this is a bug?

On Monday, May 21, 2012 9:55:41 PM UTC-3, Anthony wrote:
>
> 1) In http://web2py.com/books/default/chapter/29/9, under Authentication, 
>> it is said (regarding the user actions):
>>>
>>> By default they are all exposed, but it is possible to restrict access 
>>> to only some of these actions
>>
>> Question: How? There are no explanations or examples on what's the best 
>> way to do it (from what I know, I'd have to manually check the 
>> request.args, but is there a better approach to this?)
>>
>
> See http://web2py.com/books/default/chapter/29/9#Settings-and-messages:
>
> auth.settings.actions_disabled = ['profile', 'reset_password']
>
> 2) I'd like to have two different register pages. In one of them, the user 
>> is automatically added to the "Blue" group. On the other, he is 
>> automatically added to the "Red" group. This is how I did it:
>> (a) Created the redregister() and blueregister() actions.
>> (b) if auth.register().process().accepted, then I auth.add_membership() 
>> to the form.vars.id
>> The problem is: After registering a user, when I try to login, I receive 
>> a "Registration needs verification" message, but I haven't enabled the 
>> verification feature at all. Any clues?
>>
>
> First, instead of two separate actions, you could use the same register 
> action and just add an extra arg to the url indicating red or blue. To add 
> the membership, you could define a function that does so and register it as 
> one of the auth.settings.register_onaccept callbacks (again, see 
> http://web2py.com/books/default/chapter/29/9#Settings-and-messages).
>
> As for the verification issue, maybe print 
> auth.settings.registration_requires_verification and see if that has 
> somehow been set to True (by default it should be False).
>
> Anthony
>

Reply via email to