diff --git a/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly b/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly index ffde1f3..2757495 100644 --- a/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly +++ b/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly @@ -1,7 +1,7 @@ + checkUrl="'${rootURL}/securityRealms/LDAPSecurityRealm/serverCheck?field=server&server='+escape(this.value)+'&managerDN='+escape(this.form.elements['ldap.managerDN'].value)+'&managerPassword='+escape(this.form.elements['ldap.managerPassword'].value)"/> @@ -15,12 +15,12 @@ diff --git a/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy b/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy index 94c61c8..c56420f 100644 --- a/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy +++ b/war/resources/WEB-INF/security/LDAPBindSecurityRealm.groovy @@ -16,10 +16,10 @@ import hudson.model.Hudson */ initialDirContextFactory(DefaultInitialDirContextFactory, instance.getLDAPURL() ) { - - // if anonymous bind is not allowed --- but what is the use of anonymous bind? - // managerDn = "..." - // managerPassword="..." + if(instance.managerDN!=null) { + managerDn = instance.managerDN; + managerPassword = instance.getManagerPassword(); + } } ldapUserSearch(FilterBasedLdapUserSearch, instance.userSearchBase, instance.userSearch, initialDirContextFactory) {