--
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks Martin, it's a easy solution.
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/r_2nobzCGyc/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
--
def user():
if 'login' in request.args:
db.auth_user.username.label = T("Username or Email")
auth.settings.login_userfield = 'username'
if request.vars.username and not IS_EMAIL()(request.vars.username)[1]:
auth.settings.login_userfield = 'email'
request.vars.email = request.vars.username
request.post_vars.email = request.vars.email
request.vars.username = None
request.post_vars.username = None
return dict(form=auth())
return dict(form=auth())
Since email will be used as the only identification here, I'm not very confident after changing it couple of times the user won't mess up his memory on the latest email for login..