Show a SSO login page for SSO users that just has a login button

(imported from commit 0004bf8710491f4e2d967b4367b37d57833845ee)
This commit is contained in:
Leo Franchi 2013-11-14 10:56:07 -05:00
parent be3257de62
commit 5fd97e48c3
3 changed files with 19 additions and 6 deletions

View File

@ -864,7 +864,7 @@ a.bottom-signup-button {
font-weight: 300; font-weight: 300;
} }
.login-google, .register-google { .login-google, .register-google, .login-sso {
width: 300px; width: 300px;
margin: auto; margin: auto;
text-align: center; text-align: center;

View File

@ -25,6 +25,16 @@ autofocus('#id_username');
<h3 class="login-page-header">You look familiar.</h3> <h3 class="login-page-header">You look familiar.</h3>
{% if only_sso %}
{% comment %}SSO users don't have a password.{% endcomment %}
<div class="login-sso">
<a href="/accounts/login/sso" class="btn btn-large btn-primary">Sign in with SSO</a>
</div>
{% else %}
{% comment %}Non-SSO users.{% endcomment %}
{% if form.errors or sso_unknown_email %} {% if form.errors or sso_unknown_email %}
<div class="alert alert-error"> <div class="alert alert-error">
{% if sso_unknown_email %} {% if sso_unknown_email %}
@ -38,11 +48,11 @@ autofocus('#id_username');
</div> </div>
{% endif %} {% endif %}
{% if email %} {% if email %}
<div class="alert"> <div class="alert">
You've already registered with this email address. Please log in below. You've already registered with this email address. Please log in below.
</div> </div>
{% endif %} {% endif %}
<form name="login_form" id="login_form" method="post" class="login-form" <form name="login_form" id="login_form" method="post" class="login-form"
{% if sso_only %} {% if sso_only %}
@ -86,6 +96,8 @@ autofocus('#id_username');
</div> </div>
{% endif %} {% endif %}
{% endif %}
</div> </div>
<div class="footer-padder"></div> <div class="footer-padder"></div>
</div> </div>

View File

@ -14,6 +14,7 @@ def add_settings(request):
'zulip_admin': settings.ZULIP_ADMINISTRATOR, 'zulip_admin': settings.ZULIP_ADMINISTRATOR,
'password_auth_enabled': password_auth_enabled(), 'password_auth_enabled': password_auth_enabled(),
'login_url': settings.HOME_NOT_LOGGED_IN, 'login_url': settings.HOME_NOT_LOGGED_IN,
'only_sso': settings.ONLY_SSO,
} }
def add_metrics(request): def add_metrics(request):