summaryrefslogtreecommitdiffstats
path: root/web_src/js/index.js
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-09-10 10:30:07 -0500
committerGitHub <noreply@github.com>2020-09-10 16:30:07 +0100
commitc3e8c9441ad0e90bb0567af0bf7e9444aa8f4ad5 (patch)
tree96c8e00c1ff4b09f616df5805af6a3db11196fda /web_src/js/index.js
parent4c42fce40175b735a689289bf61ca65a8e2266b2 (diff)
downloadgitea-c3e8c9441ad0e90bb0567af0bf7e9444aa8f4ad5.tar.gz
gitea-c3e8c9441ad0e90bb0567af0bf7e9444aa8f4ad5.zip
Add check for LDAP group membership (#10869)
This is a port of gogs/gogs#4398 The only changes made by myself are: Add locales Add some JS to the UI Otherwise all code credit goes to @aboron Resolves #10829 Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'web_src/js/index.js')
-rw-r--r--web_src/js/index.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 91b6936a50..98a1033955 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1795,6 +1795,14 @@ function initAdmin() {
}
}
+ function onVerifyGroupMembershipChange() {
+ if ($('#groups_enabled').is(':checked')) {
+ $('#groups_enabled_change').show();
+ } else {
+ $('#groups_enabled_change').hide();
+ }
+ }
+
// New authentication
if ($('.admin.new.authentication').length > 0) {
$('#auth_type').on('change', function () {
@@ -1835,6 +1843,7 @@ function initAdmin() {
}
if (authType === '2' || authType === '5') {
onSecurityProtocolChange();
+ onVerifyGroupMembershipChange();
}
if (authType === '2') {
onUsePagedSearchChange();
@@ -1845,12 +1854,15 @@ function initAdmin() {
$('#use_paged_search').on('change', onUsePagedSearchChange);
$('#oauth2_provider').on('change', onOAuth2Change);
$('#oauth2_use_custom_url').on('change', onOAuth2UseCustomURLChange);
+ $('#groups_enabled').on('change', onVerifyGroupMembershipChange);
}
// Edit authentication
if ($('.admin.edit.authentication').length > 0) {
const authType = $('#auth_type').val();
if (authType === '2' || authType === '5') {
$('#security_protocol').on('change', onSecurityProtocolChange);
+ $('#groups_enabled').on('change', onVerifyGroupMembershipChange);
+ onVerifyGroupMembershipChange();
if (authType === '2') {
$('#use_paged_search').on('change', onUsePagedSearchChange);
}