NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
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] add generic-oidc provider

28679eb9
FreddleSpl0it <[email protected]> 3 years, 2 months ago
data/web/js/site/admin.js | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

Diff

diff --git a/data/web/js/site/admin.js b/data/web/js/site/admin.js
index 885e5ea5..b2f8ae1a 100644
--- a/data/web/js/site/admin.js
+++ b/data/web/js/site/admin.js
@@ -750,9 +750,9 @@ jQuery(function($){
     add_table_row($('#f2b_regex_table'), "f2b_regex");
   });
   // IAM test connection
-  $('#iam_test_connection').click(async function(e){
+  $('.iam_test_connection').click(async function(e){
     e.preventDefault();
-    var data = { attr: $('form[data-id="iam_sso"]').serializeObject() };
+    var data = { attr: $('form[data-id="' + $(this).data('id') + '"]').serializeObject() };
     var res = await fetch("/api/v1/edit/identity-provider-test", { 
       headers: {
         "Content-Type": "application/json",
@@ -768,7 +768,7 @@ jQuery(function($){
     return mailcow_alert_box(lang_danger.iam_test_connection, 'danger');
   });
 
-  $('#iam_rolemap_add').click(async function(e){
+  $('.iam_rolemap_add').click(async function(e){
     e.preventDefault();
 
     var parent = $(this).parent().parent();
@@ -791,4 +791,15 @@ jQuery(function($){
     e.preventDefault();
     $(this).parent().remove();
   });
+  // selecting identity provider
+  $('#iam_provider').on('change', function(){
+    // toggle password fields
+    if (this.value === 'keycloak'){
+      $('#keycloak_settings').removeClass('d-none');
+      $('#generic_oidc_settings').addClass('d-none');
+    } else if (this.value === 'generic-oidc') {
+      $('#keycloak_settings').addClass('d-none');
+      $('#generic_oidc_settings').removeClass('d-none');
+    }
+  });
 });