Author: toad
Date: 2008-09-03 19:14:01 +0000 (Wed, 03 Sep 2008)
New Revision: 22378

Modified:
   trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
   trunk/freenet/src/freenet/node/SecurityLevels.java
Log:
Warn the user if they select HIGH or MAXIMUM in the wizard on the network 
security level selector.


Modified: trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java  
2008-09-03 18:30:37 UTC (rev 22377)
+++ trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java  
2008-09-03 19:14:01 UTC (rev 22378)
@@ -330,6 +330,40 @@
                                super.writeTemporaryRedirect(ctx, "step1", 
TOADLET_URL+"?step="+WIZARD_STEP.SECURITY_NETWORK);
                                return;
                        }
+                       if((newThreatLevel == NETWORK_THREAT_LEVEL.MAXIMUM || 
newThreatLevel == NETWORK_THREAT_LEVEL.HIGH)) {
+                               
if((!request.isPartSet("security-levels.networkThreatLevel.confirm")) &&
+                                       
(!request.isPartSet("security-levels.networkThreatLevel.tryConfirm"))) {
+                                       HTMLNode pageNode = 
ctx.getPageMaker().getPageNode(l10n("networkSecurityPageTitle"), ctx);
+                                       HTMLNode content = 
ctx.getPageMaker().getContentNode(pageNode);
+                                       HTMLNode formNode = 
ctx.addFormChild(content, ".", "configFormSecLevels");
+                                       
+                                       formNode.addChild("input", new String[] 
{ "type", "name", "value" }, new String[] { "hidden", 
"security-levels.networkThreatLevel", networkThreatLevel });
+                                       HTMLNode infobox = 
formNode.addChild("div", "class", "infobox infobox-information");
+                                       infobox.addChild("div", "class", 
"infobox-header", l10nSec("networkThreatLevelConfirmTitle", "mode", 
SecurityLevels.localisedName(newThreatLevel)));
+                                       HTMLNode infoboxContent = 
infobox.addChild("div", "class", "infobox-content");
+                                       if(newThreatLevel == 
NETWORK_THREAT_LEVEL.MAXIMUM) {
+                                               HTMLNode p = 
infoboxContent.addChild("p");
+                                               L10n.addL10nSubstitution(p, 
"SecurityLevels.maximumNetworkThreatLevelWarning", new String[] { "bold", 
"/bold" }, new String[] { "<b>", "</b>" });
+                                               p.addChild("#", " ");
+                                               L10n.addL10nSubstitution(p, 
"SecurityLevels.maxSecurityYouNeedFriends", new String[] { "bold", "/bold" }, 
new String[] { "<b>", "</b>" });
+                                               
infoboxContent.addChild("input", new String[] { "type", "name", "value" }, new 
String[] { "checkbox", "security-levels.networkThreatLevel.confirm", "off" }, 
l10nSec("maximumNetworkThreatLevelCheckbox"));
+                                       } else /*if(newThreatLevel == 
NETWORK_THREAT_LEVEL.HIGH)*/ {
+                                               HTMLNode p = 
infoboxContent.addChild("p");
+                                               L10n.addL10nSubstitution(p, 
"FirstTimeWizardToadlet.highNetworkThreatLevelWarning", new String[] { "bold", 
"/bold" }, new String[] { "<b>", "</b>" });
+                                               
infoboxContent.addChild("input", new String[] { "type", "name", "value" }, new 
String[] { "checkbox", "security-levels.networkThreatLevel.confirm", "off" }, 
l10n("highNetworkThreatLevelCheckbox"));
+                                       }
+                                       infoboxContent.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "hidden", 
"security-levels.networkThreatLevel.tryConfirm", "on" });
+                                       formNode.addChild("input", new String[] 
{ "type", "name", "value" }, new String[] { "hidden", "seclevels", "on" });
+                                       formNode.addChild("input", new String[] 
{ "type", "value" }, new String[] { "submit", 
L10n.getString("ConfigToadlet.apply")});
+                                       formNode.addChild("input", new String[] 
{ "type", "value" }, new String[] { "reset",  
L10n.getString("ConfigToadlet.reset")});
+                                       writeHTMLReply(ctx, 200, "OK", 
pageNode.generate());
+                                       return;
+                               } else 
if((!request.isPartSet("security-levels.networkThreatLevel.confirm")) &&
+                                               
request.isPartSet("security-levels.networkThreatLevel.tryConfirm")) {
+                                       super.writeTemporaryRedirect(ctx, 
"step1", TOADLET_URL+"?step="+WIZARD_STEP.SECURITY_NETWORK);
+                                       return;
+                               }
+                       }
                        core.node.securityLevels.setThreatLevel(newThreatLevel);
                        super.writeTemporaryRedirect(ctx, "step1", 
TOADLET_URL+"?step="+WIZARD_STEP.SECURITY_FRIENDS);
                } else 
if(request.isPartSet("security-levels.friendsThreatLevel")) {

Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-09-03 
18:30:37 UTC (rev 22377)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-09-03 
19:14:01 UTC (rev 22378)
@@ -275,6 +275,8 @@
 FirstTimeWizardToadlet.continueEnd=Click here to start using Freenet!
 FirstTimeWizardToadlet.datastoreSize=Datastore size
 FirstTimeWizardToadlet.datastoreSizeLong=Please select a size for your 
datastore. The datastore acts like a cache; storing data for the network will 
help you to get better throughput when requesting popular files. The more space 
you can afford the better it is for the community and the faster your node and 
especially your downloads will go.
+FirstTimeWizardToadlet.highNetworkThreatLevelWarning=${bold}WARNING${/bold}: 
You are about to set the network security level to high. This means your node 
will not be able to connect unless ${bold}you add some connections to 
Friends${/bold}. These should be people you already know and at least 
marginally trust. If you don't know anyone already using Freenet, please use 
the NORMAL network security level so that Freenet will setup connections 
automatically. Adding people you don't know as Friends will not significantly 
improve security and will harm performance. Also note that HIGH security level 
is slower, especially if you don't have many Friends (you need 5-10 for 
adequate performance).
+FirstTimeWizardToadlet.highNetworkThreatLevelCheckbox=I know at least one 
person already using Freenet (3 preferably, 5-10 for good performance). I will 
add them on the Friends page. I understand that Freenet will not work unless 
some of my Friends are online.
 FirstTimeWizardToadlet.isNetworkTrusted=Is your local network trusted?
 FirstTimeWizardToadlet.isNetworkTrustedLong=Is your local network trusted? If 
you answer yes here all the services provided by your node will be wide open to 
everyone willing to access them on the given network. You will be able to do 
selective access controls from the configuration page when the wizard is over.
 FirstTimeWizardToadlet.noNetworkIF=No additional network interface found
@@ -1070,6 +1072,7 @@
 SecurityLevels.networkThreatLevelLowCheckbox=I am sure, I want more speed and 
I don't care who can tell what I'm doing with Freenet!
 SecurityLevels.networkThreatLevelConfirmTitle=WARNING: Setting network 
security level to ${mode}
 SecurityLevels.maximumNetworkThreatLevelWarning=${bold}WARNING:${/bold} You 
are about to set the maximum network security level! This will 
${bold}significantly${/bold} slow down Freenet for you! Please do not do this 
unless you really need the security!
+SecurityLevels.maxSecurityYouNeedFriends=${bold}You must know at least one 
person already running Freenet${/bold}, preferably 3, 5-10 for good 
performance. You must add them on the Friends page. These must be people you 
already know and at least marginally trust.
 SecurityLevels.maximumNetworkThreatLevelCheckbox=Yes I really want to enable 
maximum security, I understand that Freenet is still experimental and it may 
still be possible to trace me, and that this setting may dramatically reduce 
Freenet's performance!
 SecurityLevels.friendsThreatLevelShort=Protection if your friends attack your 
anonymity
 SecurityLevels.friendsThreatLevel=How concerned are you about those you add as 
friends attempting to monitor your activities, either deliberately or as a 
result of their computers being compromised? (This is a default level and for 
most purposes can be overridden on a per-friend basis.) If you set the network 
security level to HIGH above, then the friends security level determines 
performance, along with the number of friends added.

Modified: trunk/freenet/src/freenet/node/SecurityLevels.java
===================================================================
--- trunk/freenet/src/freenet/node/SecurityLevels.java  2008-09-03 18:30:37 UTC 
(rev 22377)
+++ trunk/freenet/src/freenet/node/SecurityLevels.java  2008-09-03 19:14:01 UTC 
(rev 22378)
@@ -301,6 +301,8 @@
                if(newThreatLevel == NETWORK_THREAT_LEVEL.MAXIMUM) {
                        HTMLNode p = parent.addChild("p");
                        L10n.addL10nSubstitution(p, 
"SecurityLevels.maximumNetworkThreatLevelWarning", new String[] { "bold", 
"/bold" }, new String[] { "<b>", "</b>" });
+                       p.addChild("#", " ");
+                       L10n.addL10nSubstitution(p, 
"SecurityLevels.maxSecurityYouNeedFriends", new String[] { "bold", "/bold" }, 
new String[] { "<b>", "</b>" });
                        parent.addChild("input", new String[] { "type", "name", 
"value" }, new String[] { "checkbox", checkboxName, "off" }, 
l10n("maximumNetworkThreatLevelCheckbox"));
                        return parent;
                }


Reply via email to