Web2py Email Authentication -
i have set web2py send email verification on registration , not allow log on until verified following settings:
mail=auth.settings.mailer mail.settings.server = 'smtp.gmail.com:587' mail.settings.sender = 'my_email_address@gmail.com' mail.settings.tls=true mail.settings.login = 'my_email_address@gmail.com:my_gmail_password' auth.settings.registration_requires_verification = true auth.settings.registration_requires_approval = false auth.settings.login_after_registration = false
email being sent password reset not registration. allowing logon.
i not sure why?
here register form code:
def register(): form = sqlform(db.auth_user) form.element('table').insert(-1,(t('please confirm not machine :'),recaptcha(request, public_key, private_key, options="theme:'white'"),'')) if form.process(onvalidation=lola).accepted: session.flash = 'record inserted' make_thumb(db.auth_user, form.vars.id,(250,250)) redirect(url('login')) return dict(form=form)
if want of registration features, such email verification, you'll need use built-in auth.register()
function:
def register(): return dict(form=auth.register())
if need run callback functions on validation , on form acceptance, can specify them using auth.settings.register_onvalidation
, auth.settings.register_onaccept
.
Comments
Post a Comment