Example #1
0
          writable=False, readable=False, default=''))

custom_auth_table = db[auth.settings.table_user_name] # get the custom_auth_table
custom_auth_table.username.requires = [
    IS_NOT_IN_DB(db, custom_auth_table.email)]
custom_auth_table.picture.requires = [IS_EMPTY_OR(
    IS_LENGTH(minsize=0, maxsize=1048576,error_message='Please choose a picture smaller than 1MB')),
    IS_IMAGE(extensions=('gif', 'jpeg', 'jpg', 'png'), error_message = 'Invalid image type'),
    RESIZE(150,150)]
custom_auth_table.website.requires = [IS_EMPTY_OR(IS_URL())]
custom_auth_table.full_name.label = "Name"
custom_auth_table.password.requires = [CRYPT()]
custom_auth_table.email.requires = [
  IS_EMAIL(error_message=auth.messages.invalid_email),
  IS_NOT_IN_DB(db, custom_auth_table.email)]

auth.settings.table_user = custom_auth_table # tell auth to use custom_auth_table
# do we want to disable flash messages
# auth.messages.logged_in = None
# auth.messages.logged_out = None
auth.define_tables(username=True, signature=False)


# keys owned by [email protected]
auth.settings.captcha = Recaptcha(request,
                                  "6LcVkQ4TAAAAAIuAW2XRHpdJFepUXFn6SRp7E-lq",
                                  "6LcVkQ4TAAAAABdgLMjQwT34YB-m8i2TAAWKag66")
auth.settings.login_captcha = False
auth.retrieve_username_captcha = False
auth.retrieve_password_captcha = False