From 0c1e2ed6f2302b9ecc68aa74063a6609fba6698f Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 16 May 2023 11:10:41 +0200 Subject: [PATCH] [Web] revert configurable authsource --- data/web/inc/functions.mailbox.inc.php | 6 +--- data/web/js/site/mailbox.js | 29 ----------------- .../web/templates/edit/mailbox-templates.twig | 9 ------ data/web/templates/modals/mailbox.twig | 31 +++++-------------- 4 files changed, 8 insertions(+), 67 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index f549785e7..b9a98043b 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -1019,7 +1019,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); return false; } - if (in_array($_data['authsource'], array('mailcow', 'keycloak'))){ + if (in_array($_data['authsource'], array('mailcow', 'keycloak', 'generic-oidc'))){ $authsource = $_data['authsource']; } if (empty($name)) { @@ -1546,9 +1546,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { // check attributes - $authsources = array('mailcow', 'keycloak'); $attr = array(); - $attr["authsource"] = (isset($_data['authsource']) && in_array($_data['authsource'], $authsources)) ? $_data['authsource'] : 'mailcow'; $attr["quota"] = isset($_data['quota']) ? intval($_data['quota']) * 1048576 : 0; $attr['tags'] = (isset($_data['tags'])) ? $_data['tags'] : array(); $attr["quarantine_notification"] = (!empty($_data['quarantine_notification'])) ? $_data['quarantine_notification'] : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']); @@ -3236,9 +3234,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { $_data["template"] = (isset($_data["template"])) ? $_data["template"] : $is_now["template"]; } // check attributes - $authsources = array('mailcow', 'keycloak'); $attr = array(); - $attr["authsource"] = (isset($_data['authsource']) && in_array($_data['authsource'], $authsources)) ? $_data['authsource'] : $is_now['authsource']; $attr["quota"] = isset($_data['quota']) ? intval($_data['quota']) * 1048576 : 0; $attr['tags'] = (isset($_data['tags'])) ? $_data['tags'] : $is_now['tags']; $attr["quarantine_notification"] = (!empty($_data['quarantine_notification'])) ? $_data['quarantine_notification'] : $is_now['quarantine_notification']; diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index 06c1444d3..1dc6b4f5b 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -162,17 +162,6 @@ $(document).ready(function() { } }); }); - // @selecting identity provider mbox_add_modal - $('#mbox_add_iam').on('change', function(){ - // toggle password fields - if (this.value === 'mailcow'){ - $('#mbox_add_pwds').removeClass('d-none'); - $('#mbox_add_pwds').find('.form-control').prop('required', true); - } else { - $('#mbox_add_pwds').addClass('d-none'); - $('#mbox_add_pwds').find('.form-control').prop('required', false); - } - }); // Sieve data modal $('#sieveDataModal').on('show.bs.modal', function(e) { var sieveScript = $(e.relatedTarget).data('sieve-script'); @@ -280,15 +269,6 @@ $(document).ready(function() { } function setMailboxTemplateData(template){ $("#addInputQuota").val(template.quota / 1048576); - $('#mbox_add_iam').selectpicker('val', template.authsource); - // toggle password fields - if (!template.authsource || template.authsource === 'mailcow'){ - $('#mbox_add_pwds').removeClass('d-none'); - $('#mbox_add_pwds').find('.form-control').prop('required', true); - } else { - $('#mbox_add_pwds').addClass('d-none'); - $('#mbox_add_pwds').find('.form-control').prop('required', false); - } if (template.quarantine_notification === "never"){ $('#quarantine_notification_never').prop('checked', true); @@ -1291,15 +1271,6 @@ jQuery(function($){ data: 'attributes.quota', defaultContent: '', }, - { - title: lang.iam, - data: 'attributes.authsource', - defaultContent: '', - render: function (data, type) { - data = data ? '' + data + '' : ''; - return data; - } - }, { title: lang.tls_enforce_in, data: 'attributes.tls_enforce_in', diff --git a/data/web/templates/edit/mailbox-templates.twig b/data/web/templates/edit/mailbox-templates.twig index c83a15dd7..f606bd452 100644 --- a/data/web/templates/edit/mailbox-templates.twig +++ b/data/web/templates/edit/mailbox-templates.twig @@ -19,15 +19,6 @@ -
- -
- -
-
diff --git a/data/web/templates/modals/mailbox.twig b/data/web/templates/modals/mailbox.twig index e0b4f02b6..27f709526 100644 --- a/data/web/templates/modals/mailbox.twig +++ b/data/web/templates/modals/mailbox.twig @@ -11,19 +11,20 @@ + -
- -
- -
-
+
+ +
+ +
+
@@ -41,15 +42,6 @@
-
- -
- -
-
@@ -236,15 +228,6 @@
-
- -
- -
-