Beispiel #1
0
 def __init__(self,
              app_title,
              app_banner,
              theme,
              mail_sender_service,
              assets_manager_service,
              moderator='',
              identicons=False,
              username=''):
     '''
     Register a new user (`username` not provided)
     or register email for an existing unconfirmed user (`username` provided).
     If `moderator` is set to an email address, all confirmation requests are sent there instead of user's email.
     '''
     self.app_title = app_title
     self.app_banner = app_banner
     self.theme = theme
     self.mail_sender = mail_sender_service
     self.assets_manager = assets_manager_service
     self.moderator = moderator
     self.identicons = identicons
     self.state = None  # task state, initialized by a URL rule
     self.user_manager = usermanager.UserManager()
     self.username = username
     self.alt_title = _(u'Sign up')
Beispiel #2
0
 def __init__(self, app_title, app_banner, theme, mail_sender_service):
     """Be careful! The confirmation URL *should* be rooted"""
     self.app_title = app_title
     self.app_banner = app_banner
     self.theme = theme
     self.mail_sender = mail_sender_service
     self.state = None  # task state, initialized by a URL rule
     self.user_manager = usermanager.UserManager()
     self.alt_title = _(u'Reset password')
Beispiel #3
0
def get_or_create_data_user(suffixe=''):
    '''Get test user for suffixe, or create if not exists'''
    user_test = usermanager.UserManager.get_by_username(u'usertest_%s' %
                                                        suffixe)
    if not user_test:
        user_test = usermanager.UserManager().create_user(
            u'usertest_%s' % suffixe, u'password', u'User Test %s' % suffixe,
            u'*****@*****.**' % suffixe)
        session.add(user_test)
    return user_test
Beispiel #4
0
 def __init__(self, app_title, app_banner, theme):
     self.username = editor.Property('').validate(self.validate_username)
     self.email = editor.Property('').validate(self.validate_email)
     self.fullname = editor.Property('').validate(validator.validate_non_empty_string)
     self.password = editor.Property('').validate(validator.validate_password)
     self.password_repeat = editor.Property('').validate(validator.validate_password)
     self.init_captcha_image()
     self.captcha_text = editor.Property('').validate(self.validate_captcha)
     self.header = component.Component(Header(app_title, app_banner, theme))
     self.user_manager = usermanager.UserManager()
     self.error_message = u''
     self.alt_title = _(u'Sign up')