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

jvergara
23.57.2008 91ffff639defea1f4d50bea853ccdf8aaffd5bf2
Use the adress specified in the configuration instead of "localhost" as LDAP URLs.
1 files modified
21 ■■■■ changed files
opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromFile.java 21 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromFile.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.guitools.statuspanel;
@@ -38,6 +38,7 @@
import org.opends.server.core.DirectoryServer;
import org.opends.admin.ads.ADSContext;
import org.opends.admin.ads.util.ConnectionUtils;
import org.opends.messages.Message;
import org.opends.server.util.LDIFException;
import org.opends.server.util.LDIFReader;
@@ -242,6 +243,7 @@
      if (desc.getState() == ListenerDescriptor.State.ENABLED)
      {
        int port = -1;
        String host = "localhost";
        try
        {
          String addressPort = desc.getAddressPort();
@@ -249,6 +251,10 @@
          if (index != -1)
          {
            port = Integer.parseInt(addressPort.substring(index+1));
            if (index > 0)
            {
              host = addressPort.substring(0, index);
            }
          }
          else
          {
@@ -262,7 +268,7 @@
        if (port != -1)
        {
          url = "ldap://localhost:"+port;
          url = "ldap://"+ConnectionUtils.getHostNameForLdapUrl(host)+":"+port;
          break;
        }
      }
@@ -363,6 +369,7 @@
      {
        int port = -1;
        String host = "localhost";
        try
        {
          String addressPort = desc.getAddressPort();
@@ -370,6 +377,10 @@
          if (index != -1)
          {
            port = Integer.parseInt(addressPort.substring(index+1));
            if (index > 0)
            {
              host = addressPort.substring(0, index);
            }
          }
          else
          {
@@ -386,13 +397,15 @@
          if (!secure &&
              (desc.getProtocol() == ListenerDescriptor.Protocol.LDAP))
          {
            url = "ldap://localhost:"+port;
            url = "ldap://"+ConnectionUtils.getHostNameForLdapUrl(host)+":"+
            port;
            break;
          }
          if (secure &&
              (desc.getProtocol() == ListenerDescriptor.Protocol.LDAPS))
          {
            url = "ldaps://localhost:"+port;
            url = "ldaps://"+ConnectionUtils.getHostNameForLdapUrl(host)+":"+
            port;
            break;
          }
        }