]> source.dussan.org Git - archiva.git/commitdiff
verify ldap groups dn too
authorOlivier Lamy <olamy@apache.org>
Mon, 11 Feb 2013 17:13:39 +0000 (17:13 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 11 Feb 2013 17:13:39 +0000 (17:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1444882 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java

index 1752aad0dd1d08054794dd08594a44416edff02b..e6694dc90a3d7cebf47d7e2e65b4189fab35f57f 100644 (file)
@@ -151,7 +151,6 @@ public class DefaultRedbackRuntimeConfigurationService
             usersCache.setMaxElementsOnDisk(
                 redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() );
 
-
             ldapUserMapper.initialize();
 
             return Boolean.TRUE;
@@ -237,6 +236,20 @@ public class DefaultRedbackRuntimeConfigurationService
                                                  toProperties( ldapConfiguration.getExtraProperties() ) );
 
             ldapConnection = ldapConnectionFactory.getConnection( ldapConnectionConfiguration );
+
+            ldapConnection.close();
+
+            // verify groups dn value too
+
+            ldapConnectionConfiguration =
+                new LdapConnectionConfiguration( ldapConfiguration.getHostName(), ldapConfiguration.getPort(),
+                                                 ldapConfiguration.getBaseGroupsDn(),
+                                                 ldapConfiguration.getContextFactory(), ldapConfiguration.getBindDn(),
+                                                 ldapConfiguration.getPassword(),
+                                                 ldapConfiguration.getAuthenticationMethod(),
+                                                 toProperties( ldapConfiguration.getExtraProperties() ) );
+
+            ldapConnection = ldapConnectionFactory.getConnection( ldapConnectionConfiguration );
         }
         catch ( InvalidNameException e )
         {