summaryrefslogtreecommitdiffstats
path: root/askbot/conf/user_settings.py
blob: a2d8d3860c4ae3b67958c00cdfcfaab0ca451eca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
"""
User policy settings
"""
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION
from askbot.deps import livesettings
from django.conf import settings as django_settings
from askbot.skins import utils as skin_utils
from django.utils.translation import ugettext_lazy as _
from askbot import const

USER_SETTINGS = livesettings.ConfigurationGroup(
                    'USER_SETTINGS',
                    _('User settings'),
                    super_group = LOGIN_USERS_COMMUNICATION
                )

settings.register(
    livesettings.LongStringValue(
        USER_SETTINGS,
        'NEW_USER_GREETING',
        default='',
        description=_('On-screen greeting shown to the new users')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'ALLOW_ANONYMOUS_FEEDBACK',
        default=True,
        description=_('Allow anonymous users send feedback')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'EDITABLE_SCREEN_NAME',
        default = True,
        description = _('Allow editing user screen name')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'AUTOFILL_USER_DATA',
        default = True,
        description = _('Auto-fill user name, email, etc on registration'),
        help_text = _('Implemented only for LDAP logins at this point')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'EDITABLE_EMAIL',
        default = True,
        description = _('Allow users change own email addresses')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'ALLOW_EMAIL_ADDRESS_IN_USERNAME',
        default=True,
        description=_('Allow email address in user name')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'ALLOW_ACCOUNT_RECOVERY_BY_EMAIL',
        default = True,
        description = _('Allow account recovery by email')
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'ALLOW_ADD_REMOVE_LOGIN_METHODS',
        default = True,
        description = _('Allow adding and removing login methods')
    )
)

settings.register(
    livesettings.IntegerValue(
        USER_SETTINGS,
        'MIN_USERNAME_LENGTH',
        hidden=True,
        default=1,
        description=_('Minimum allowed length for screen name')
    )
)

settings.register(
    livesettings.ImageValue(
        USER_SETTINGS,
        'DEFAULT_AVATAR_URL',
        description = _('Default avatar for users'),
        help_text = _(
                        'To change the avatar image, select new file, '
                        'then submit this whole form.'
                    ),
        default = '/images/nophoto.png',
        url_resolver = skin_utils.get_media_url
    )
)

settings.register(
    livesettings.BooleanValue(
        USER_SETTINGS,
        'ENABLE_GRAVATAR',
        default = True,
        description = _('Use automatic avatars from gravatar.com'),
        help_text=_(
            'Check this option if you want to allow the use of gravatar.com for avatars. Please, note that this feature might take about 10 minutes to become fully effective. You will have to enable uploaded avatars as well. For more information, please visit <a href="http://askbot.org/doc/optional-modules.html#uploaded-avatars">this page</a>.'
        ) 
    )
)


settings.register(
    livesettings.StringValue(
        USER_SETTINGS,
        'GRAVATAR_TYPE',
        default='identicon',
        choices=const.GRAVATAR_TYPE_CHOICES,
        description=_('Default Gravatar icon type'),
        help_text=_(
                    'This option allows you to set the default avatar type for email addresses without associated gravatar images.  For more information, please visit <a href="http://en.gravatar.com/site/implement/images/">this page</a>.'
                    ) 
    )
)

settings.register(
    livesettings.StringValue(
        USER_SETTINGS,
        'NAME_OF_ANONYMOUS_USER',
        default = '',
        description = _('Name for the Anonymous user')
    )
)