1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

Disable signup when not in cloud_mode

This commit is contained in:
zhengxie
2012-11-21 16:24:08 +08:00
parent 763286c77e
commit 1b686fc8cf
2 changed files with 36 additions and 25 deletions

View File

@@ -27,6 +27,15 @@ urlpatterns = patterns('',
activate,
{ 'backend': 'seahub.base.accounts.RegistrationBackend', },
name='registration_activate'),
(r'', include('registration.auth_urls')),
)
try:
from settings import CLOUD_MODE
except ImportError:
CLOUD_MODE = False
if CLOUD_MODE:
urlpatterns += patterns('',
url(r'^register/$',
register,
reg_dict,
@@ -40,5 +49,5 @@ urlpatterns = patterns('',
direct_to_template,
{ 'template': 'registration/registration_closed.html' },
name='registration_disallowed'),
(r'', include('registration.auth_urls')),
)

View File

@@ -62,8 +62,10 @@
<a href="{{ SITE_ROOT }}accounts/logout/">{% trans "Log out" %}</a>
{% else %}
<a href="{{ SITE_ROOT }}accounts/login/">{% trans "Log In" %}</a>
{% if cloud_mode %}
<a href="{{ SITE_ROOT }}accounts/register/">{% trans "Signup" %}</a>
{% endif %}
{% endif %}
<a href="#" id="lang-context" data="no-popup" data-lang="{{ LANGUAGE_CODE }}">
{{ LANGUAGE_CODE|language_name_local }}
<span class="tri-bg tri-down-bg"></span>
@@ -73,7 +75,7 @@
<li><a href="{% url 'i18n' %}?lang={{ LANG.0 }}">{{ LANG.1 }}</a></li>
{% endfor %}
</ul>
</div>
</div> <!-- /.account -->
</div>
</div>
</div>