diff options
author | Unknwon <u@gogs.io> | 2016-07-08 07:25:09 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-08 07:25:09 +0800 |
commit | 401bf944ef4b09e7d4ca85d7272dbd32e7e950a0 (patch) | |
tree | 7e9af9199616f4704d4e1e9e0bfcf97d537693e4 /public | |
parent | 326c98266040a69ceec51c3804c372c7af47e027 (diff) | |
download | gitea-401bf944ef4b09e7d4ca85d7272dbd32e7e950a0.tar.gz gitea-401bf944ef4b09e7d4ca85d7272dbd32e7e950a0.zip |
Use SecurityProtocol to replace UseSSL in LDAP config
Initially proposed by #2376 and fixes #3068 as well.
Diffstat (limited to 'public')
-rw-r--r-- | public/js/gogs.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index b80caa0d04..71e2205f2f 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -612,6 +612,13 @@ function initAdmin() { }); } + function onSecurityProtocolChange() { + if ($('#security_protocol').val() > 0) { + $('.has-tls').show(); + } else { + $('.has-tls').hide(); + } + } // New authentication if ($('.admin.new.authentication').length > 0) { @@ -620,6 +627,7 @@ function initAdmin() { $('.dldap').hide(); $('.smtp').hide(); $('.pam').hide(); + $('.has-tls').hide(); var auth_type = $(this).val(); switch (auth_type) { @@ -628,6 +636,7 @@ function initAdmin() { break; case '3': // SMTP $('.smtp').show(); + $('.has-tls').show(); break; case '4': // PAM $('.pam').show(); @@ -636,7 +645,19 @@ function initAdmin() { $('.dldap').show(); break; } + + if (auth_type == '2' || auth_type == '5') { + onSecurityProtocolChange() + } }); + $('#security_protocol').change(onSecurityProtocolChange) + } + // Edit authentication + if ($('.admin.edit.authentication').length > 0) { + var auth_type = $('#auth_type').val(); + if (auth_type == '2' || auth_type == '5') { + $('#security_protocol').change(onSecurityProtocolChange); + } } // Notice |