summaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-05-05 17:30:47 +0300
committerGitHub <noreply@github.com>2018-05-05 17:30:47 +0300
commit501fb228e6c2b4d75593fae835d59cc533a6f36b (patch)
tree748b452140e041757ee9f1efb1e53de3ed59812e /public/js
parent7467ff3d94537880d8d6ee3925d682b6de15ae77 (diff)
downloadgitea-501fb228e6c2b4d75593fae835d59cc533a6f36b.tar.gz
gitea-501fb228e6c2b4d75593fae835d59cc533a6f36b.zip
Add option to use paged LDAP search when synchronizing users (#3895)
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index f1d308457e..dc473b6f3b 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1138,6 +1138,16 @@ function initAdmin() {
}
}
+ function onUsePagedSearchChange() {
+ if ($('#use_paged_search').prop('checked')) {
+ $('.search-page-size').show()
+ .find('input').attr('required', 'required');
+ } else {
+ $('.search-page-size').hide()
+ .find('input').removeAttr('required');
+ }
+ }
+
function onOAuth2Change() {
$('.open_id_connect_auto_discovery_url, .oauth2_use_custom_url').hide();
$('.open_id_connect_auto_discovery_url input[required]').removeAttr('required');
@@ -1191,7 +1201,7 @@ function initAdmin() {
// New authentication
if ($('.admin.new.authentication').length > 0) {
$('#auth_type').change(function () {
- $('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls').hide();
+ $('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls .search-page-size').hide();
$('.ldap input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required]').removeAttr('required');
@@ -1223,9 +1233,13 @@ function initAdmin() {
if (authType == '2' || authType == '5') {
onSecurityProtocolChange()
}
+ if (authType == '2') {
+ onUsePagedSearchChange();
+ }
});
$('#auth_type').change();
$('#security_protocol').change(onSecurityProtocolChange);
+ $('#use_paged_search').change(onUsePagedSearchChange);
$('#oauth2_provider').change(onOAuth2Change);
$('#oauth2_use_custom_url').change(onOAuth2UseCustomURLChange);
}
@@ -1234,6 +1248,9 @@ function initAdmin() {
var authType = $('#auth_type').val();
if (authType == '2' || authType == '5') {
$('#security_protocol').change(onSecurityProtocolChange);
+ if (authType == '2') {
+ $('#use_paged_search').change(onUsePagedSearchChange);
+ }
} else if (authType == '6') {
$('#oauth2_provider').change(onOAuth2Change);
$('#oauth2_use_custom_url').change(onOAuth2UseCustomURLChange);