mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
05.14.2007 21ee5a44d30731fef7efe5744667d3acf44823cf
- remove useless test
- fix a buf (we don't need bindDN if client side authentication is required)
1 files modified
82 ■■■■■ changed files
opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java 82 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java
@@ -207,17 +207,15 @@
        }
      }
      if (secureConnection)
      if (useSSL || useStartTSL)
      {
        if (useSSL || useStartTSL)
        {
          // Get truststore info
          trustManager = getTrustManager();
        // Get truststore info
        trustManager = getTrustManager();
          // Check if we need client side authentication
          keyManager = getKeyManager();
        }
        // Check if we need client side authentication
        keyManager = getKeyManager();
      }
      // Get the LDAP host.
      String hostName = secureArgsList.hostNameArg.getValue();
      final String tmpHostName = hostName;
@@ -326,38 +324,54 @@
      // Get the LDAP bind credentials.
      String bindDN = secureArgsList.bindDnArg.getValue();
      final String tmpBindDN = bindDN;
      if (app.isInteractive() && (keyManager == null)
          && !secureArgsList.bindDnArg.isPresent())
      if (keyManager == null)
      {
        if (!isHeadingDisplayed) {
          app.println();
          app.println();
          app.println(INFO_DSCFG_HEADING_CONNECTION_PARAMETERS.get());
          isHeadingDisplayed = true;
        }
        ValidationCallback<String> callback = new ValidationCallback<String>() {
          public String validate(ConsoleApplication app, String input)
              throws CLIException {
            String ninput = input.trim();
            if (ninput.length() == 0) {
              return tmpBindDN;
            } else {
              return ninput;
            }
        if (app.isInteractive() && !secureArgsList.bindDnArg.isPresent())
        {
          if (!isHeadingDisplayed)
          {
            app.println();
            app.println();
            app.println(INFO_DSCFG_HEADING_CONNECTION_PARAMETERS.get());
            isHeadingDisplayed = true;
          }
        };
          ValidationCallback<String> callback = new ValidationCallback<String>()
          {
        try {
          app.println();
          bindDN = app.readValidatedInput(
              INFO_DSCFG_PROMPT_BIND_DN.get(bindDN), callback);
        } catch (CLIException e) {
          throw ArgumentExceptionFactory.unableToReadConnectionParameters(e);
            public String validate(ConsoleApplication app, String input)
                throws CLIException
            {
              String ninput = input.trim();
              if (ninput.length() == 0)
              {
                return tmpBindDN;
              }
              else
              {
                return ninput;
              }
            }
          };
          try
          {
            app.println();
            bindDN = app.readValidatedInput(INFO_DSCFG_PROMPT_BIND_DN
                .get(bindDN), callback);
          }
          catch (CLIException e)
          {
            throw ArgumentExceptionFactory
                .unableToReadConnectionParameters(e);
          }
        }
      }
      else
      {
        bindDN = null ;
      }
      String bindPassword = secureArgsList.bindPasswordArg.getValue();
      if (keyManager == null)