You just need to define a custom auth table. If you define a username
field it will be used instead of email when you login. You can define
any other fields you want. For example in your model:
from gluon.tools import *
auth=Auth(globals(),db)
auth_table = db.define_table("auth_user",
db.Field("first_name", length=128,default=""),
db.Field("last_name", length=128,default=""),
db.Field('username',length=128,default=""),
db.Field("email", length=128,default=""),
db.Field("password", 'password',length=128,readable=False,
label="Password"),
db.Field("registration_key", length=256, writable=False,
readable=False, default=""))
auth.settings.table_user = auth_table
There is more on page 245(labeled 229) of the manual.
On Oct 23, 7:25 pm, Wiiboy <[email protected]> wrote:
> How does one extend the auth system (e.g. adding more fields, like
> user avatar, username, etc.)? I've seen a couple things in Wikis and
> so on, but nothing has been very clear.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---