Example #1
0
 def fields(self):
     username = ew.TextField(name='username',
                             label='Desired Username',
                             validator=fev.Regex(h.re_project_name))
     username.validator._messages['invalid'] = (
         'Usernames must include only small letters, numbers, and dashes.'
         ' They must also start with a letter and be at least 3 characters'
         ' long.')
     fields = [
         ew.TextField(name='display_name',
                      label='Displayed Name',
                      validator=fev.UnicodeString(not_empty=True)),
         username,
     ]
     if asbool(config.get('auth.require_email_addr', False)):
         fields.append(
             ew.TextField(name='email',
                          label='Your e-mail',
                          validator=fev.Email(not_empty=True)))
     fields += [
         ew.PasswordField(
             name='pw',
             label='New Password',
             validator=fev.UnicodeString(
                 not_empty=True,
                 min=asint(tg.config.get('auth.min_password_len', 6)),
                 max=asint(tg.config.get('auth.max_password_len', 30)))),
         ew.PasswordField(name='pw2',
                          label='New Password (again)',
                          validator=fev.UnicodeString(not_empty=True)),
     ]
     return fields
Example #2
0
 def fields(self):
     username = ew.TextField(
         name='username',
         label='Desired Username',
         validator=plugin.AuthenticationProvider.get(
             None).username_validator(),
     )
     fields = [
         ew.TextField(name='display_name',
                      label='Displayed Name',
                      validator=V.UnicodeString(not_empty=True)),
         username,
     ]
     if asbool(config.get('auth.require_email_addr', False)):
         fields.append(
             ew.TextField(name='email',
                          label='Your e-mail',
                          validator=fev.Email(not_empty=True)))
     fields += [
         ew.PasswordField(
             name='pw',
             label='New Password',
             attrs=dict(
                 minlength=asint(tg.config.get('auth.min_password_len', 6)),
                 maxlength=asint(tg.config.get('auth.max_password_len',
                                               30))),
             validator=V.UnicodeString(
                 not_empty=True,
                 min=asint(tg.config.get('auth.min_password_len', 6)),
                 max=asint(tg.config.get('auth.max_password_len', 30)))),
         ew.PasswordField(name='pw2',
                          label='New Password (again)',
                          validator=V.UnicodeString(not_empty=True)),
     ]
     return fields
Example #3
0
 def fields(self):
     return [
         ew.PasswordField(
             name='oldpw',
             label='Old Password',
             validator=V.UnicodeString(not_empty=True),
             attrs=dict(
                 required=True,
                 autocomplete='current-password',
             ),
         ),
         ew.PasswordField(
             name='pw',
             label='New Password',
             attrs=dict(
                 minlength=asint(tg.config.get('auth.min_password_len', 6)),
                 maxlength=asint(tg.config.get('auth.max_password_len', 30)),
                 required=True,
                 autocomplete='new-password',
             ),
             validator=V.UnicodeString(
                 not_empty=True,
                 min=asint(tg.config.get('auth.min_password_len', 6)),
                 max=asint(tg.config.get('auth.max_password_len', 30)))),
         ew.PasswordField(
             name='pw2',
             label='New Password (again)',
             validator=V.UnicodeString(not_empty=True),
             attrs=dict(
                 required=True,
                 autocomplete='new-password',
             ),
         ),
         ew.HiddenField(name='return_to'),
     ]
Example #4
0
 class fields(ew_core.NameList):
     oldpw = ew.PasswordField(label='Old Password',
                              validator=fev.UnicodeString(not_empty=True))
     pw = ew.PasswordField(label='New Password',
                           validator=fev.UnicodeString(not_empty=True,
                                                       min=6))
     pw2 = ew.PasswordField(label='New Password (again)',
                            validator=fev.UnicodeString(not_empty=True))
Example #5
0
 def fields(self):
     return [
         ew.PasswordField(
             name='pw',
             label='New Password',
             validator=fev.UnicodeString(
                 not_empty=True,
                 min=asint(tg.config.get('auth.min_password_len', 6)),
                 max=asint(tg.config.get('auth.max_password_len', 30)))),
         ew.PasswordField(name='pw2',
                          label='New Password (again)',
                          validator=fev.UnicodeString(not_empty=True)),
     ]
Example #6
0
 class fields(ew_core.NameList):
     display_name = ew.TextField(
         label='Displayed Name',
         validator=fev.UnicodeString(not_empty=True))
     username = ew.TextField(label='Desired Username',
                             validator=fev.Regex(h.re_path_portion))
     username.validator._messages['invalid'] = (
         'Usernames must include only letters, numbers, and dashes.'
         ' They must also start with a letter and be at least 3 characters'
         ' long.')
     pw = ew.PasswordField(label='New Password',
                           validator=fev.UnicodeString(not_empty=True,
                                                       min=8))
     pw2 = ew.PasswordField(label='New Password (again)',
                            validator=fev.UnicodeString(not_empty=True))
Example #7
0
    def fields(self):
        fields = [
            ew.TextField(name=g.antispam.enc('username'), label='Username', attrs={
                'autofocus': 'autofocus',
                'placeholder': 'Username' if plugin.ThemeProvider.get().use_input_placeholders() else '',
                'autocomplete': 'username',
                'autocapitalize': 'none',
            }),
            ew.PasswordField(name=g.antispam.enc('password'), label='Password', attrs={
                'placeholder': 'Password' if plugin.ThemeProvider.get().use_input_placeholders() else '',
                'autocomplete': 'current-password',
            }),
            ew.Checkbox(
                name=g.antispam.enc('rememberme'),
                label='Remember Me',
                attrs={'style': 'margin-left: 162px;'}),
            ew.HiddenField(name='return_to'),
        ]
        if plugin.AuthenticationProvider.get(request).forgotten_password_process:
            # only show link if auth provider has method of recovering password
            fields.append(
                ew.HTMLField(
                    name='link',
                    text='<a href="/auth/forgotten_password" style="margin-left:162px" target="_top">'
                         'Forgot password?</a>'))

        for fld in g.antispam.extra_fields():
            fields.append(
                ew_core.Widget(template=ew.Snippet(fld)))

        return fields
Example #8
0
 def fields(self):
     fields = [
         ew.TextField(name='username', label='Username', attrs={
             'autofocus': 'autofocus',
         }),
         ew.PasswordField(name='password', label='Password'),
         ew.Checkbox(
             name='rememberme',
             label='Remember Me',
             attrs={'style': 'margin-left: 162px;'}),
         ew.HiddenField(name='return_to'),
     ]
     if plugin.AuthenticationProvider.get(request).forgotten_password_process:
         # only show link if auth provider has method of recovering password
         fields.append(
             ew.HTMLField(
                 name='link',
                 text='<a href="/auth/forgotten_password" style="margin-left:162px" target="_top">'
                      'Forgot password?</a>'))
     return fields
Example #9
0
 class fields(ew_core.NameList):
     password = ew.PasswordField(name='password', label='Account password')
 class fields(ew_core.NameList):
     username = ew.TextField(label='Username')
     password = ew.PasswordField(label='Password')