diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 70855269..7c242e15 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -1956,7 +1956,7 @@ function identity_provider($_action, $_data = null, $_extra = null) { $_data['mailpassword_flow'] = isset($_data['mailpassword_flow']) ? intval($_data['mailpassword_flow']) : 0; $_data['periodic_sync'] = isset($_data['periodic_sync']) ? intval($_data['periodic_sync']) : 0; $_data['import_users'] = isset($_data['import_users']) ? intval($_data['import_users']) : 0; - $required_settings = array('authsource', 'server_url', 'realm', 'client_id', 'client_secret', 'redirect_url', 'version', 'mailpassword_flow', 'periodic_sync', 'import_users'); + $required_settings = array('authsource', 'server_url', 'realm', 'client_id', 'client_secret', 'redirect_url', 'version', 'mailpassword_flow', 'periodic_sync', 'import_users', 'sync_interval'); } else if ($_data['authsource'] == "generic-oidc") { $required_settings = array('authsource', 'authorize_url', 'token_url', 'client_id', 'client_secret', 'redirect_url', 'userinfo_url'); } diff --git a/data/web/js/site/admin.js b/data/web/js/site/admin.js index 095cee01..117527c6 100644 --- a/data/web/js/site/admin.js +++ b/data/web/js/site/admin.js @@ -768,10 +768,10 @@ jQuery(function($){ return mailcow_alert_box(lang_danger.iam_test_connection, 'danger'); }); - $('.iam_rolemap_add').click(async function(e){ + $('.iam_rolemap_add_keycloak').click(async function(e){ e.preventDefault(); - var parent = $('#iam_mapping_list') + var parent = $('#iam_keycloak_mapping_list') $(parent).children().last().clone().appendTo(parent); var newChild = $(parent).children().last(); $(newChild).find('input').val(''); @@ -781,17 +781,42 @@ jQuery(function($){ $(newChild).find('select').selectpicker('destroy'); $(newChild).find('select').selectpicker(); - $('.iam_rolemap_del').off('click'); - $('.iam_rolemap_del').click(async function(e){ + $('.iam_keycloak_rolemap_del').off('click'); + $('.iam_keycloak_rolemap_del').click(async function(e){ e.preventDefault(); - if ($(this).parent().parent().children().length > 1) - $(this).parent().remove(); + if ($(this).parent().parent().parent().parent().children().length > 1) + $(this).parent().parent().parent().remove(); }); }); - $('.iam_rolemap_del').click(async function(e){ + $('.iam_rolemap_add_generic').click(async function(e){ e.preventDefault(); - if ($(this).parent().parent().children().length > 1) - $(this).parent().remove(); + + var parent = $('#iam_generic_mapping_list') + $(parent).children().last().clone().appendTo(parent); + var newChild = $(parent).children().last(); + $(newChild).find('input').val(''); + $(newChild).find('.dropdown-toggle').remove(); + $(newChild).find('.dropdown-menu').remove(); + $(newChild).find('.bs-title-option').remove(); + $(newChild).find('select').selectpicker('destroy'); + $(newChild).find('select').selectpicker(); + + $('.iam_generic_rolemap_del').off('click'); + $('.iam_generic_rolemap_del').click(async function(e){ + e.preventDefault(); + if ($(this).parent().parent().parent().parent().children().length > 1) + $(this).parent().parent().parent().remove(); + }); + }); + $('.iam_keycloak_rolemap_del').click(async function(e){ + e.preventDefault(); + if ($(this).parent().parent().parent().parent().children().length > 1) + $(this).parent().parent().parent().remove(); + }); + $('.iam_generic_rolemap_del').click(async function(e){ + e.preventDefault(); + if ($(this).parent().parent().parent().parent().children().length > 1) + $(this).parent().parent().parent().remove(); }); // selecting identity provider $('#iam_provider').on('change', function(){ diff --git a/data/web/templates/admin/tab-config-identity-provider.twig b/data/web/templates/admin/tab-config-identity-provider.twig index a2aff987..e7ba01b8 100644 --- a/data/web/templates/admin/tab-config-identity-provider.twig +++ b/data/web/templates/admin/tab-config-identity-provider.twig @@ -7,10 +7,10 @@ {{ lang.admin.iam }}
-

{{ lang.admin.iam_description }}

+

{{ lang.admin.iam_description|raw }}

- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
@@ -52,62 +52,82 @@
- -
+ +
- +
-
- -
- Attribute - Template - -
-
- {% for key, role in iam_settings.mappers %} -
- - - +
+ +
+
+ Attribute + {{ lang.mailbox.template }} +
+ +
- {% endfor %} - {% if not iam_settings.mappers %} -
- - - -
- {% endif %}
+
+ {% for key, role in iam_settings.mappers %} +
+
+
+ +
+
+ +
+
+ +
+
+
+ {% endfor %} + {% if not iam_settings.mappers %} +
+
+
+ +
+
+ +
+
+ +
+
+
+ {% endif %} +
- -
+ +
{{ lang.admin.iam_extra_permission|raw }}
- -
+ +
@@ -119,28 +139,34 @@
- -
+ +
- -
+ +
+
+ +
+ +
+
-
-
+
+
- +
@@ -149,32 +175,32 @@
- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
@@ -182,52 +208,74 @@
- -
+ +
-
- -
- Attribute - Template - +
+ +
+
+ Attribute + Template +
+ +
+
+
+
{% for key, role in iam_settings.mappers %} -
- - - +
+
+
+ +
+
+ +
+
+ +
+
{% endfor %} {% if not iam_settings.mappers %} -
- - - +
+
+
+ +
+
+ +
+
+ +
+
{% endif %}
-
-
+
+
- +