Maybe look at how Auth.register does it for the password 
field: http://code.google.com/p/web2py/source/browse/gluon/tools.py#1905. 
In your user function, you might do something like:

def user():
    if request.args(0) == 'register':
        form = auth.register(onvalidation=verify_email)
        [code to add the email verification field to the form]
    else:
        form = auth()
    return dict(form = form)

Then define a verify_email() function that takes the form and confirms that 
the two email address fields are the same (actually, at the time the 
onvalidation function is called within Auth.register, I don't think the 
second email address field will be present in the form, so you might have 
to access the value of the second field via request.vars instead of 
form.vars).

Anthony

On Thursday, March 1, 2012 1:01:34 PM UTC-5, greenguerilla wrote:
>
> Hi guys,
>
> I'm wondering if anyone knows of a good way to add a 'verify email' field 
> to auth's register form?
>
> I basically want to replicate the verify password functionality for the 
> email field but I notice that this is done inside the auth.register method 
> after the creation of the SQLFORM:
>
> if self.settings.register_verify_password:
> ..... Create the verify password field and append to the form....
>
> Is there a nice way to do this without either modifying the auth.register 
> code or adding a bogus field to the auth_user table?
>
> Cheers,
>
> John
>
>

Reply via email to