[Web] Disable SSO button when admin login is disabled, fixes #4297

master
andryyy 2021-10-27 13:42:45 +02:00
parent c0011013b8
commit f01de1a5c0
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 10 additions and 3 deletions

View File

@ -44,6 +44,7 @@ $globalVariables = [
'available_languages' => $AVAILABLE_LANGUAGES,
'lang' => $lang,
'skip_sogo' => (getenv('SKIP_SOGO') == 'y'),
'allow_admin_email_login' => (getenv('ALLOW_ADMIN_EMAIL_LOGIN') == 'n'),
'mailcow_apps' => $MAILCOW_APPS,
'app_links' => customize('get', 'app_links'),
'is_root_uri' => (parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) == '/'),

View File

@ -6,9 +6,15 @@
<div class="row">
<div class="hidden-xs col-md-3 col-xs-5 text-right"></div>
<div class="col-md-3 col-xs-12">
<a target="_blank" href="/sogo-auth.php?login={{ mailcow_cc_username }}" role="button" class="btn btn-default btn-block btn-xs-lg">
{% if dual_login and allow_admin_email_login == 'n' %}
<button disabled class="btn btn-default btn-block btn-xs-lg">
<i class="bi bi-inbox-fill"></i> {{ lang.user.open_webmail_sso }}
</button>
{% else %}
<a target="_blank" href="#" disabled role="button" class="btn btn-default btn-block btn-xs-lg">
<i class="bi bi-inbox-fill"></i> {{ lang.user.open_webmail_sso }}
</a>
{% endif %}
</div>
</div>
<hr>