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

jvergara
23.51.2009 5dd35ae2e29ec569de41bca273bfe7ef2921b7e5
Fix for issue 3890 (Control Panel LDAP browser displays 0.0.0.0 in the root entry)
3 files modified
28 ■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/browser/BrowserController.java 13 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java 8 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java 7 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/browser/BrowserController.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.guitools.controlpanel.browser;
@@ -57,6 +57,7 @@
import org.opends.admin.ads.ADSContext;
import org.opends.admin.ads.util.ConnectionUtils;
import org.opends.guitools.controlpanel.datamodel.ServerDescriptor;
import org.opends.guitools.controlpanel.event.BrowserEvent;
import org.opends.guitools.controlpanel.event.BrowserEventListener;
import org.opends.guitools.controlpanel.event.ReferralAuthenticationListener;
@@ -174,14 +175,18 @@
   * Set the connection for accessing the directory.  Since we must use
   * different controls when searching the configuration and the user data,
   * two connections must be provided (this is done to avoid synchronization
   * issues).
   * issues).  We also pass the server descriptor corresponding to the
   * connections to have a proper rendering of the root node.
   * @param server the server descriptor.
   * @param ctxConfiguration the connection to be used to retrieve the data in
   * the configuration base DNs.
   * @param ctxUserData the connection to be used to retrieve the data in the
   * user base DNs.
   * @throws NamingException if an error occurs.
   */
  public void setConnections(InitialLdapContext ctxConfiguration,
  public void setConnections(
      ServerDescriptor server,
      InitialLdapContext ctxConfiguration,
      InitialLdapContext ctxUserData) throws NamingException {
    String rootNodeName;
    if (ctxConfiguration != null)
@@ -192,7 +197,7 @@
      this.ctxConfiguration.setRequestControls(
          getConfigurationRequestControls());
      this.ctxUserData.setRequestControls(getRequestControls());
      rootNodeName = ConnectionUtils.getHostName(ctxConfiguration) + ":" +
      rootNodeName = server.getHostname() + ":" +
      ConnectionUtils.getPort(ctxConfiguration);
    }
    else {
opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
@@ -889,9 +889,7 @@
        {
          if (port > 0)
          {
            url = sProtocol +"://"+
            ConnectionUtils.getHostNameForLdapUrl(
                server.getHostname())+":"+port;
            url = sProtocol +"://localhost:"+port;
          }
        }
        else
@@ -924,9 +922,7 @@
    SortedSet<InetAddress> addresses = desc.getAddresses();
    if (addresses.size() == 0) {
      if (port > 0) {
        url = "ldaps://" +
          ConnectionUtils.getHostNameForLdapUrl(
          server.getHostname()) + ":" + port;
        url = "ldaps://localhost:" + port;
      }
    } else {
      if (port > 0) {
opends/src/guitools/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.guitools.controlpanel.ui;
@@ -1213,8 +1213,9 @@
              {
                try
                {
                  controller.setConnections(getInfo().getDirContext(),
                        getInfo().getUserDataDirContext());
                  controller.setConnections(getInfo().getServerDescriptor(),
                      getInfo().getDirContext(),
                      getInfo().getUserDataDirContext());
                  applyButtonClicked();
                }
                catch (NamingException ne)