summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/admin-common.js
diff options
context:
space:
mode:
authorSven Seeberg <sven@geeq.de>2022-02-11 15:24:58 +0100
committerGitHub <noreply@github.com>2022-02-11 22:24:58 +0800
commit832ce406aefed0cceb30d42d1435f425a9aba279 (patch)
tree7089998c621efe706fba829be9d6c31d97210ee7 /web_src/js/features/admin-common.js
parent26718a785ac49f17eab51ad0f5324d036b810f73 (diff)
downloadgitea-832ce406aefed0cceb30d42d1435f425a9aba279.tar.gz
gitea-832ce406aefed0cceb30d42d1435f425a9aba279.zip
Add LDAP group sync to Teams, fixes #1395 (#16299)
* Add setting for a JSON that maps LDAP groups to Org Teams. * Add log when removing or adding team members. * Sync is being run on login and periodically. * Existing group filter settings are reused. * Adding and removing team members. * Sync not existing LDAP group. * Login with broken group map JSON.
Diffstat (limited to 'web_src/js/features/admin-common.js')
-rw-r--r--web_src/js/features/admin-common.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/web_src/js/features/admin-common.js b/web_src/js/features/admin-common.js
index d2021c45aa..2438fcf62b 100644
--- a/web_src/js/features/admin-common.js
+++ b/web_src/js/features/admin-common.js
@@ -91,12 +91,8 @@ export function initAdminCommon() {
}
}
- function onVerifyGroupMembershipChange() {
- if ($('#groups_enabled').is(':checked')) {
- $('#groups_enabled_change').show();
- } else {
- $('#groups_enabled_change').hide();
- }
+ function onEnableLdapGroupsChange() {
+ $('#ldap-group-options').toggle($('.js-ldap-group-toggle').is(':checked'));
}
// New authentication
@@ -139,7 +135,7 @@ export function initAdminCommon() {
}
if (authType === '2' || authType === '5') {
onSecurityProtocolChange();
- onVerifyGroupMembershipChange();
+ onEnableLdapGroupsChange();
}
if (authType === '2') {
onUsePagedSearchChange();
@@ -150,15 +146,15 @@ export function initAdminCommon() {
$('#use_paged_search').on('change', onUsePagedSearchChange);
$('#oauth2_provider').on('change', () => onOAuth2Change(true));
$('#oauth2_use_custom_url').on('change', () => onOAuth2UseCustomURLChange(true));
- $('#groups_enabled').on('change', onVerifyGroupMembershipChange);
+ $('.js-ldap-group-toggle').on('change', onEnableLdapGroupsChange);
}
// 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();
+ $('.js-ldap-group-toggle').on('change', onEnableLdapGroupsChange);
+ onEnableLdapGroupsChange();
if (authType === '2') {
$('#use_paged_search').on('change', onUsePagedSearchChange);
}