public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Web] Disable SSO button when admin login is disabled, fixes #4297
f01de1a5
data/web/inc/header.inc.php | 1 +
data/web/templates/user/tab-user-auth.twig | 12 +++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
Diff
diff --git a/data/web/inc/header.inc.php b/data/web/inc/header.inc.php
index feea441f..6c783a0b 100644
--- a/data/web/inc/header.inc.php
+++ b/data/web/inc/header.inc.php
@@ -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) == '/'),
diff --git a/data/web/templates/user/tab-user-auth.twig b/data/web/templates/user/tab-user-auth.twig
index f658215a..0dbfbb00 100644
--- a/data/web/templates/user/tab-user-auth.twig
+++ b/data/web/templates/user/tab-user-auth.twig
@@ -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">
- <i class="bi bi-inbox-fill"></i> {{ lang.user.open_webmail_sso }}
- </a>
+ {% 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>