From ddca0eb7a96ddbbe6f0ecf8d40caf2390507a4b5 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 22 Jun 2009 14:09:58 +0000
Subject: [PATCH] Use the remote host name when creating the URLs used to browse the user data.

---
 opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java b/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
index 648406b..bb825d0 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
@@ -449,7 +449,7 @@
     desc.setSchema(reader.getSchema());
     desc.setSchemaEnabled(reader.isSchemaEnabled());
   }
-  private int i=0;
+
   /**
    * Regenerates the last found ServerDescriptor object.
    *
@@ -1029,17 +1029,36 @@
         {
           if (port > 0)
           {
-            url = sProtocol +"://localhost:"+port;
+            if (server.isLocal())
+            {
+              url = sProtocol +"://localhost:"+port;
+            }
+            else
+            {
+              url = sProtocol +"://"+
+              ConnectionUtils.getHostNameForLdapUrl(server.getHostname())+
+              ":"+port;
+            }
           }
         }
         else
         {
           if (port > 0)
           {
-            InetAddress address = addresses.first();
-            url = sProtocol +"://"+
-            ConnectionUtils.getHostNameForLdapUrl(address.getHostAddress())+":"+
-            port;
+            if (server.isLocal())
+            {
+              InetAddress address = addresses.first();
+              url = sProtocol +"://"+
+              ConnectionUtils.getHostNameForLdapUrl(address.getHostAddress())+
+              ":"+
+              port;
+            }
+            else
+            {
+              url = sProtocol +"://"+
+              ConnectionUtils.getHostNameForLdapUrl(server.getHostname())+
+              ":"+port;
+            }
           }
         }
       }

--
Gitblit v1.10.0