So, I have db/table where i have data, i want just login user by the my field/data:
def user():
auth = Auth(db, signature=False)
auth.settings.create_user_groups = False
db.define_table('user_psw',
Field('tabnum', 'id', readable=False, writable=False),
Field('name', readable=False, writable=False),
Field('pwd', 'password', requires=CRYPT(), readable=False),
Field('ipadr'),
Field('groupid'),
Field('registration_key', writable=False, readable=False, default=''),
Field('reset_password_key', writable=False, readable=False, default=''),
Field('registration_id', writable=False, readable=False, default='')
)
if request.args(0) == 'login':
auth.settings.showid = False
auth.settings.table_user_name = 'user_psw'
auth.settings.login_userfield = 'name'
auth.settings.password_field = 'pwd'
auth.settings.login_next = URL('index.html')
auth.settings.logout_next = URL('index.html')
auth.settings.actions_disabled.append('register')
auth.settings.login_email_validate = False
custom_auth_table = db[auth.settings.table_user_name]
custom_auth_table.name.requires = IS_NOT_EMPTY()
custom_auth_table.pwd.requires = CRYPT()
auth.settings.table_user = custom_auth_table
login works, but some error:
File "D:\Web\server\web2py\gluon\tools.py", line 4159, in update_groups
table_membership.user_id == self.user.id).select()
File "D:\Web\server\web2py\gluon\packages\dal\pydal\objects.py", line 90, in __getattr__
raise AttributeError
AttributeError
Whats wrong? I write -
auth.settings.create_user_groups = False
How i can disable this? In project i dont need any groups, memebership, etc... only login