Author: toad
Date: 2008-01-15 13:02:40 +0000 (Tue, 15 Jan 2008)
New Revision: 17056

Modified:
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
   trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
Log:
Port forward suggestion in NAT warning: mention both ports in the HTML version

Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-01-15 
12:53:43 UTC (rev 17055)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-01-15 
13:02:40 UTC (rev 17056)
@@ -461,6 +461,7 @@
 IPDetectorPluginManager.suggestForwardPort= You may want to forward the port 
(UDP port number ${port}) manually. (See 
http://wiki.freenetproject.org/FirewallAndRouterIssues ).
 IPDetectorPluginManager.suggestForwardTwoPorts= You may want to forward the 
ports (UDP port numbers ${port1} and ${port2}) manually. (See 
http://wiki.freenetproject.org/FirewallAndRouterIssues ).
 IPDetectorPluginManager.suggestForwardPortWithLink= You may want to 
${link}forward the port${/link} (UDP port number ${port}) manually (or you may 
already have done so, Freenet cannot easily detect this).
+IPDetectorPluginManager.suggestForwardTwoPortsWithLink= You may want to 
${link}forward the ports${/link} (UDP port numbers ${port1} and ${port2}) 
manually (or you may already have done so, Freenet cannot easily detect this).
 IPDetectorPluginManager.symmetric=Your internet connection appears to be 
behind a symmetric NAT or firewall. You will probably only be able to connect 
to users directly connected to the internet or behind restricted cone NATs.
 IPDetectorPluginManager.symmetricTitle=Symmetric firewall detected
 IPUndetectedUserAlert.detecting=Freenet is currently attempting to detect your 
external IP address. If this takes more than a few minutes there is something 
wrong...

Modified: trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
===================================================================
--- trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2008-01-15 
12:53:43 UTC (rev 17055)
+++ trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2008-01-15 
13:02:40 UTC (rev 17056)
@@ -45,8 +45,16 @@
                        HTMLNode div = new HTMLNode("div");
                        div.addChild("#", super.getText());
                        if(suggestPortForward) {
-                               L10n.addL10nSubstitution(div, 
"IPDetectorPluginManager.suggestForwardPortWithLink", new String[] { "link", 
"/link", "port" },
-                                               new String[] { "<a 
href=\"/?_CHECKED_HTTP_=http://wiki.freenetproject.org/FirewallAndRouterIssues\";>",
 "</a>", Integer.toString(node.getDarknetPortNumber()) });
+                               // FIXME we should support any number of ports, 
UDP or TCP, and pick them up from the node as we do with the forwarding plugin 
... that would be a bit of a pain for L10n though ...
+                               int darknetPort = node.getDarknetPortNumber();
+                               int opennetPort = node.getOpennetFNPPort();
+                               if(opennetPort <= 0) {
+                                       L10n.addL10nSubstitution(div, 
"IPDetectorPluginManager.suggestForwardPortWithLink", new String[] { "link", 
"/link", "port" },
+                                                       new String[] { "<a 
href=\"/?_CHECKED_HTTP_=http://wiki.freenetproject.org/FirewallAndRouterIssues\";>",
 "</a>", Integer.toString(node.getDarknetPortNumber()) });
+                               } else {
+                                       L10n.addL10nSubstitution(div, 
"IPDetectorPluginManager.suggestForwardTwoPortsWithLink", new String[] { 
"link", "/link", "port1", "port2" },
+                                                       new String[] { "<a 
href=\"/?_CHECKED_HTTP_=http://wiki.freenetproject.org/FirewallAndRouterIssues\";>",
 "</a>", Integer.toString(node.getDarknetPortNumber()), 
Integer.toString(opennetPort) });
+                               }
                        }
                        return div;
                }
@@ -76,7 +84,7 @@
                public void onDismiss() {
                        valid = false;
                }
-
+               
                public boolean userCanDismiss() {
                        return !suggestPortForward;
                }


Reply via email to