1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

add seahub web settings page

This commit is contained in:
lian
2015-09-21 11:48:07 +08:00
parent 49fb5ca174
commit 4baf74926b
22 changed files with 421 additions and 119 deletions

View File

@@ -297,6 +297,8 @@ from django.utils.http import urlquote
from registration.signals import user_registered
from seahub.utils import get_site_scheme_and_netloc
from constance import config
# Get an instance of a logger
logger = logging.getLogger(__name__)
@@ -308,8 +310,9 @@ def email_admin_on_registration(sender, **kwargs):
This email will be sent when both ``ACTIVATE_AFTER_REGISTRATION`` and
``REGISTRATION_SEND_MAIL`` are set to False.
"""
if settings.ACTIVATE_AFTER_REGISTRATION is False and \
settings.REGISTRATION_SEND_MAIL is False:
if config.ACTIVATE_AFTER_REGISTRATION is False and \
config.REGISTRATION_SEND_MAIL is False:
reg_email = kwargs['user'].email
ctx_dict = {

View File

@@ -7,10 +7,13 @@ Views which allow users to create and activate accounts.
from django.shortcuts import redirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import Http404
from registration.backends import get_backend
from seahub.settings import USER_PASSWORD_MIN_LENGTH, \
USER_STRONG_PASSWORD_REQUIRED, USER_PASSWORD_STRENGTH_LEVEL
from constance import config
from seahub import settings
def activate(request, backend,
template_name='registration/activate.html',
@@ -176,6 +179,12 @@ def register(request, backend, success_url=None, form_class=None,
argument.
"""
if not config.ENABLE_SIGNUP:
raise Http404
if config.ACTIVATE_AFTER_REGISTRATION:
success_url = settings.SITE_ROOT
backend = get_backend(backend)
if not backend.registration_allowed(request):
return redirect(disallowed_url)
@@ -207,7 +216,7 @@ def register(request, backend, success_url=None, form_class=None,
return render_to_response(template_name, {
'form': form,
'min_len': USER_PASSWORD_MIN_LENGTH,
'strong_pwd_required': USER_STRONG_PASSWORD_REQUIRED,
'level': USER_PASSWORD_STRENGTH_LEVEL,
'min_len': config.USER_PASSWORD_MIN_LENGTH,
'strong_pwd_required': config.USER_STRONG_PASSWORD_REQUIRED,
'level': config.USER_PASSWORD_STRENGTH_LEVEL,
}, context_instance=context)