Пример #1
0
        description=_('Feedback site URL'),
        help_text=_(
            'If left empty, a simple internal feedback form '
            'will be used instead'
        )
    )
)

settings.register(
    livesettings.LongStringValue(
        FEEDBACK,
        'FEEDBACK_PAGE_MESSAGE',
        localized=True,
        description=_('Message on the feedback page'),
        default=_(
            '**Dear {{ USER_NAME }}**, we look forward to hearing your '
            'feedback. Please type and send us your message below.'
        ),
        help_text=_(
            'Save, then <a href="http://validator.w3.org/">'
            'use HTML validator</a> on the "terms" page to check your input.'
        )
    )
)


# TODO: Remove old_value
def feedback_emails_callback(old_value, new_value):
    """validates the fedback emails list"""
    emails = []
    for value in re.split(r'\s*,\s*', new_value):
        if not value:
Пример #2
0
settings.register(
    livesettings.StringValue(
        EXTERNAL_KEYS,
        'IDENTICA_SECRET',
        description=_('ident.ca consumer secret'),
    ))

settings.register(
    livesettings.BooleanValue(
        EXTERNAL_KEYS,
        'USE_LDAP_FOR_PASSWORD_LOGIN',
        description=_('Use LDAP authentication for the password login'),
        defaut=False))

settings.register(
    livesettings.StringValue(EXTERNAL_KEYS,
                             'LDAP_PROVIDER_NAME',
                             description=_('LDAP service provider name')))

settings.register(
    livesettings.StringValue(EXTERNAL_KEYS,
                             'LDAP_URL',
                             description=_('URL for the LDAP service')))

settings.register(
    livesettings.LongStringValue(
        EXTERNAL_KEYS,
        'HOW_TO_CHANGE_LDAP_PASSWORD',
        description=_('Explain how to change LDAP password')))
Пример #3
0
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
import re

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')))
Пример #4
0
    ('nothing', _('nothing - not required')),
    ('see-content', _('access to content')),
    #'post-content', _('posting content'),
)

settings.register(
    livesettings.StringValue(ACCESS_CONTROL,
                             'REQUIRE_VALID_EMAIL_FOR',
                             default='nothing',
                             choices=EMAIL_VALIDATION_CASE_CHOICES,
                             description=_('Require valid email for')))

settings.register(
    livesettings.LongStringValue(
        ACCESS_CONTROL,
        'ALLOWED_EMAILS',
        default='',
        description=_('Allowed email addresses'),
        help_text=_('Please use space to separate the entries')))

settings.register(
    livesettings.LongStringValue(
        ACCESS_CONTROL,
        'ALLOWED_EMAIL_DOMAINS',
        default='',
        description=_('Allowed email domain names'),
        help_text=_(
            'Please use space to separate the entries, do not use the @ symbol!'
        )))

settings.register(
    livesettings.BooleanValue(
Пример #5
0
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
import re

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

settings.register(
    livesettings.LongStringValue(
        USER_SETTINGS,
        'NEW_USER_GREETING',
        default=_('Welcome to our community!'),
        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')))
Пример #6
0
    ))

settings.register(
    livesettings.BooleanValue(
        ACCESS_CONTROL,
        'NEW_REGISTRATIONS_DISABLED',
        default=False,
        description=_('Disable registration of new users'),
    ))

settings.register(
    livesettings.LongStringValue(
        ACCESS_CONTROL,
        'NEW_REGISTRATIONS_DISABLED_MESSAGE',
        default=_(
            '<p>New users cannot be registered at this time. Please sign '
            'in if you already have an account.</p>'),
        description=_(
            'Message explaining that user registrations are disabled'),
        help_text=_('HTML is allowed')))

EMAIL_VALIDATION_CASE_CHOICES = (
    ('nothing', _('nothing - not required')),
    ('see-content', _('account registration')),
    # ('post-content', _('posting content')),
)

settings.register(
    livesettings.StringValue(ACCESS_CONTROL,
                             'REQUIRE_VALID_EMAIL_FOR',
                             default='nothing',
Пример #7
0
settings.register(
    livesettings.StringValue(
        EMAIL_TEXT,
        'EMAIL_TEXT_SHORT_WELCOME',
        description=_('Short welcome message, for subject line'),
        default=_('Welcome to {{ SITE_NAME }}!'),
        help_text=_(
            '<b>NOTE: All email text settings allow placeholders: '
            '{{ USER_NAME }}, {{ SITE_NAME }} and {{ SITE_LINK }}.</b>')))

settings.register(
    livesettings.LongStringValue(
        EMAIL_TEXT,
        'EMAIL_TEXT_LONG_WELCOME',
        description=_('Longer welcome message, for email body'),
        default=_('<p>Please visit {{ SITE_NAME }} at {{ SITE_LINK }}, we '
                  'look forward to your posts.</p>'),
    ))

settings.register(
    livesettings.LongStringValue(
        EMAIL_TEXT,
        'EMAIL_TEXT_FOOTER',
        description=_('Email footer'),
        default=_('<p>Sincerely,<br>{{ SITE_NAME }} Administrator</p>')))

settings.register(
    livesettings.LongStringValue(
        EMAIL_TEXT,
        'EMAIL_TEXT_BATCH_ALERT_HEADER',
Пример #8
0
#        default=False,
#        description=_('Require valid email address to register')
#    )
#)
def update_email_callback(old, new):
    if new.strip():
        settings.update('BLACKLISTED_EMAIL_PATTERNS_MODE', 'disabled')
    return new


settings.register(
    livesettings.LongStringValue(
        ACCESS_CONTROL,
        'ALLOWED_EMAILS',
        default='',
        description=_('Allowed email addresses'),
        help_text=string_concat(
            _('Please use space to separate the entries'), '. ',
            _('Entry disables blacklisted email patterns')),
        update_callback=update_email_callback))

settings.register(
    livesettings.LongStringValue(
        ACCESS_CONTROL,
        'ALLOWED_EMAIL_DOMAINS',
        default='',
        description=_('Allowed email domain names'),
        help_text=string_concat(
            _('Please use space to separate the entries, do not use the @ symbol!'
              ), '. ', _('Entry disables blacklisted email patterns')),
        update_callback=update_email_callback))