Author: toad
Date: 2009-01-21 13:45:28 +0000 (Wed, 21 Jan 2009)
New Revision: 25182
Removed:
trunk/freenet/src/freenet/clients/http/NullToadletContainer.java
Modified:
trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
trunk/freenet/src/freenet/clients/http/BrowserTestToadlet.java
trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java
trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java
trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
trunk/freenet/src/freenet/clients/http/N2NTMToadlet.java
trunk/freenet/src/freenet/clients/http/PageMaker.java
trunk/freenet/src/freenet/clients/http/PproxyToadlet.java
trunk/freenet/src/freenet/clients/http/QueueToadlet.java
trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java
trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
trunk/freenet/src/freenet/clients/http/StaticToadlet.java
trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
trunk/freenet/src/freenet/clients/http/Toadlet.java
trunk/freenet/src/freenet/clients/http/ToadletContext.java
trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
trunk/freenet/src/freenet/clients/http/TranslationToadlet.java
trunk/freenet/src/freenet/clients/http/UserAlertsToadlet.java
trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java
trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
trunk/freenet/src/freenet/node/Announcer.java
trunk/freenet/src/freenet/node/DarknetPeerNode.java
trunk/freenet/src/freenet/node/FNPPacketMangler.java
trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
trunk/freenet/src/freenet/node/Node.java
trunk/freenet/src/freenet/node/NodeIPDetector.java
trunk/freenet/src/freenet/node/PacketSender.java
trunk/freenet/src/freenet/node/SecurityLevels.java
trunk/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java
trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java
trunk/freenet/src/freenet/node/useralerts/BuildOldAgeUserAlert.java
trunk/freenet/src/freenet/node/useralerts/ClockProblemDetectedUserAlert.java
trunk/freenet/src/freenet/node/useralerts/ExtOldAgeUserAlert.java
trunk/freenet/src/freenet/node/useralerts/IPUndetectedUserAlert.java
trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java
trunk/freenet/src/freenet/node/useralerts/MeaningfulNodeNameUserAlert.java
trunk/freenet/src/freenet/node/useralerts/N2NTMUserAlert.java
trunk/freenet/src/freenet/node/useralerts/NotEnoughNiceLevelsUserAlert.java
trunk/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java
trunk/freenet/src/freenet/node/useralerts/TimeSkewDetectedUserAlert.java
trunk/freenet/src/freenet/node/useralerts/UpdatedVersionAvailableUserAlert.java
trunk/freenet/src/freenet/node/useralerts/UserAlert.java
trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java
trunk/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
trunk/freenet/test/freenet/support/io/MockInputStream.java
Log:
Part 1 of reverting history cloaking:
Do not revert all related changes - some refactoring is kept, eliminating
activelinks is kept. The latter caused one conflict in WelcomeToadlet.java,
this was a 1 line fix, has been resolved.
Reverted:
25122
25121
25117
25116
25115
25110
25109
25090
25088
25050
25049
25048
25004
25003
25002
24987
24986
24980
24979
24978
24977
24976
24975
24974
24973
24971
24970
24969 (conflicted)
Modified: trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -256,7 +256,7 @@
}
HTMLNode bookmarksBox =
content.addChild(pageMaker.getInfobox("infobox-normal",
L10n.getString("BookmarkEditorToadlet.myBookmarksTitle")));
-
pageMaker.getContentNode(bookmarksBox).addChild(getBookmarksList(container));
+
pageMaker.getContentNode(bookmarksBox).addChild(getBookmarksList(ctx));
HTMLNode addDefaultBookmarksForm = ctx.addFormChild(content,
"", "AddDefaultBookmarks");
addDefaultBookmarksForm.addChild("input", new String[]{"type",
"name", "value"}, new String[]{"submit", "AddDefaultBookmarks",
L10n.getString("BookmarkEditorToadlet.addDefaultBookmarks")});
@@ -277,7 +277,7 @@
String passwd = req.getPartAsString("formPassword", 32);
boolean noPassword = (passwd == null) ||
!passwd.equals(core.formPassword);
if(noPassword) {
- writePermanentRedirect(ctx, "Invalid", PATH);
+ writePermanentRedirect(ctx, "Invalid", "");
return;
}
@@ -354,7 +354,7 @@
pageMaker.getContentNode(errorBox).addChild("#",
L10n.getString("BookmarkEditorToadlet.invalidKey"));
}
HTMLNode bookmarksBox =
content.addChild(pageMaker.getInfobox("infobox-normal",
L10n.getString("BookmarkEditorToadlet.myBookmarksTitle")));
-
pageMaker.getContentNode(bookmarksBox).addChild(getBookmarksList(container));
+
pageMaker.getContentNode(bookmarksBox).addChild(getBookmarksList(ctx));
HTMLNode addDefaultBookmarksForm = ctx.addFormChild(content,
"", "AddDefaultBookmarks");
addDefaultBookmarksForm.addChild("input", new String[]{"type",
"name", "value"}, new String[]{"submit", "AddDefaultBookmarks",
L10n.getString("BookmarkEditorToadlet.addDefaultBookmarks")});
Modified: trunk/freenet/src/freenet/clients/http/BrowserTestToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/BrowserTestToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/BrowserTestToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -191,7 +191,7 @@
HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
+ contentNode.addChild(core.alerts.createSummary(ctx));
// #### Test MIME inline
HTMLNode mimeAutodetectBox =
contentNode.addChild(ctx.getPageMaker().getInfobox("infobox-warning", "MIME
Inline"));
Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -56,7 +56,7 @@
@Override
public String getText() {
- return getHTMLText(container).toString();
+ return getHTMLText(NullLinkFixer.instance).toString();
}
@Override
@@ -65,13 +65,15 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode alertNode = new HTMLNode("div");
alertNode.addChild("#", l10n("needRestart"));
if (node.isUsingWrapper()) {
alertNode.addChild("br");
- HTMLNode restartForm =
fixer.addFormChild(alertNode, "/", "restartForm");
+ HTMLNode restartForm =
alertNode.addChild("form", //
+ new String[] { "action",
"method", "enctype" },//
+ new String[] { "/", "post",
"multipart/form-data" });
restartForm.addChild("div");
restartForm.addChild("input",//
new String[] { "type", "name"
},//
@@ -119,7 +121,7 @@
String pass = request.getPartAsString("formPassword", 32);
if((pass == null) || !pass.equals(core.formPassword)) {
MultiValueTable<String,String> headers = new
MultiValueTable<String,String>();
- headers.put("Location", container.fixLink("/config/"));
+ headers.put("Location", "/config/");
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
@@ -229,7 +231,7 @@
return;
} else {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink("/config/?mode="+MODE_SECURITY_LEVELS));
+ headers.put("Location",
"/config/?mode="+MODE_SECURITY_LEVELS);
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
return;
}
@@ -320,9 +322,9 @@
HTMLNode infobox =
contentNode.addChild(ctx.getPageMaker().getInfobox("infobox-normal",
l10n("possibilitiesTitle")));
HTMLNode content = ctx.getPageMaker().getContentNode(infobox);
- content.addChild("a", new String[]{"href", "title"}, new
String[]{container.fixLink("/config/"), l10n("shortTitle")},
l10n("returnToNodeConfig"));
+ content.addChild("a", new String[]{"href", "title"}, new
String[]{ctx.fixLink("/config/"), l10n("shortTitle")},
l10n("returnToNodeConfig"));
content.addChild("br");
- addHomepageLink(content, container);
+ addHomepageLink(content, ctx);
writeHTMLReply(ctx, 200, "OK", pageNode.generate());
@@ -348,9 +350,9 @@
HTMLNode pageNode =
ctx.getPageMaker().getPageNode(L10n.getString("ConfigToadlet.fullTitle", new
String[] { "name" }, new String[] { node.getMyName() }), ctx);
HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
- contentNode.addChild(core.alerts.createSummary(container));
+ contentNode.addChild(core.alerts.createSummary(ctx));
- final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, container, req, contentNode,
MODE_SECURITY_LEVELS, "SecurityLevels.title", "SecurityLevels.tooltip",
"/config/");
+ final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, ctx, req, contentNode,
MODE_SECURITY_LEVELS, "SecurityLevels.title", "SecurityLevels.tooltip",
"/config/");
if(mode == MODE_SECURITY_LEVELS) {
drawSecurityLevelsPage(contentNode, ctx);
@@ -360,7 +362,7 @@
HTMLNode navigationBar =
ctx.getPageMaker().getInfobox("navbar", l10n("configNavTitle"));
HTMLNode navigationContent =
ctx.getPageMaker().getContentNode(navigationBar).addChild("ul");
if(!L10n.getSelectedLanguage().equals(L10n.LANGUAGE.getDefault()))
- navigationContent.addChild("a", "href",
container.fixLink(TranslationToadlet.TOADLET_URL),
l10n("contributeTranslation"));
+ navigationContent.addChild("a", "href",
ctx.fixLink(TranslationToadlet.TOADLET_URL), l10n("contributeTranslation"));
HTMLNode navigationTable =
navigationContent.addChild("table", "class", "config_navigation");
HTMLNode navigationTableRow =
navigationTable.addChild("tr");
HTMLNode nextTableCell = navigationTableRow;
@@ -388,9 +390,9 @@
String defaultValue = "128";
item.addChild("span", new String[]{ "class",
"title", "style" },
new String[]{
"configshortdesc", L10n.getString("ConfigToadlet.defaultIs", new String[] {
"default" }, new String[] { defaultValue }),
- "cursor: help;"
}).addChild(L10n.getHTMLNode("WrapperConfig."+configName+".short", container));
+ "cursor: help;"
}).addChild(L10n.getHTMLNode("WrapperConfig."+configName+".short", ctx));
item.addChild("span", "class",
"config").addChild("input", new String[] { "type", "class", "name", "value" },
new String[] { "text", "config", configName, curValue });
- item.addChild("span", "class",
"configlongdesc").addChild(L10n.getHTMLNode("WrapperConfig."+configName+".long",
container));
+ item.addChild("span", "class",
"configlongdesc").addChild(L10n.getHTMLNode("WrapperConfig."+configName+".long",
ctx));
}
}
@@ -409,7 +411,7 @@
HTMLNode configItemNode =
configGroupUlNode.addChild("li");
configItemNode.addChild("span", new
String[]{ "class", "title", "style" },
new String[]{
"configshortdesc", L10n.getString("ConfigToadlet.defaultIs", new String[] {
"default" }, new String[] { o[j].getDefault() }) + (mode >=
PageMaker.MODE_ADVANCED ? " ["+sc[i].getPrefix() + '.' + o[j].getName() + ']' :
""),
- "cursor: help;"
}).addChild(L10n.getHTMLNode(o[j].getShortDesc(), container));
+ "cursor: help;"
}).addChild(L10n.getHTMLNode(o[j].getShortDesc(), ctx));
HTMLNode configItemValueNode =
configItemNode.addChild("span", "class", "config");
if(o[j].getValueString() == null){
Logger.error(this,
sc[i].getPrefix() + configName + "has returned null from config!);");
@@ -434,7 +436,7 @@
new String[] { "text",
"config", o[j].getShortDesc(),
sc[i].getPrefix() + '.' + configName, o[j].getValueString() });
- configItemNode.addChild("span",
"class", "configlongdesc").addChild(L10n.getHTMLNode(o[j].getLongDesc(),
container));
+ configItemNode.addChild("span",
"class", "configlongdesc").addChild(L10n.getHTMLNode(o[j].getLongDesc(), ctx));
}
}
Modified: trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -236,8 +236,8 @@
long now = System.currentTimeMillis();
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
- final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, container, request,
contentNode, getURL());
+ contentNode.addChild(core.alerts.createSummary(ctx));
+ final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, ctx, request, contentNode,
getURL());
if(peerNodeStatuses.length>0){
@@ -360,7 +360,7 @@
if (mode >= PageMaker.MODE_ADVANCED) {
if (!path.endsWith("displaymessagetypes.html"))
{
peerTableInfoboxHeader.addChild("#", "
");
- peerTableInfoboxHeader.addChild("a",
"href", container.fixLink(getURL()+"displaymessagetypes.html"), "(more
detailed)");
+ peerTableInfoboxHeader.addChild("a",
"href", "displaymessagetypes.html", "(more detailed)");
}
}
HTMLNode peerTableInfoboxContent =
peerTableInfobox.addChild("div", "class", "infobox-content");
@@ -380,30 +380,30 @@
HTMLNode peerTableHeaderRow =
peerTable.addChild("tr");
if(enablePeerActions)
peerTableHeaderRow.addChild("th");
- peerTableHeaderRow.addChild("th").addChild("a",
"href", container.fixLink(sortString(isReversed, "status"))).addChild("#",
l10n("statusTitle"));
+ peerTableHeaderRow.addChild("th").addChild("a",
"href", sortString(isReversed, "status")).addChild("#", l10n("statusTitle"));
if(hasNameColumn())
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "name"))).addChild("span", new
String[] { "title", "style" }, new String[] { l10n("nameClickToMessage"),
"border-bottom: 1px dotted; cursor: help;" }, l10n("nameTitle"));
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"name")).addChild("span", new String[] { "title", "style" }, new String[] {
l10n("nameClickToMessage"), "border-bottom: 1px dotted; cursor: help;" },
l10n("nameTitle"));
if (mode >= PageMaker.MODE_ADVANCED) {
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "address"))).addChild("span", new
String[] { "title", "style" }, new String[] { l10n("ipAddress"),
"border-bottom: 1px dotted; cursor: help;" }, l10n("ipAddressTitle"));
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"address")).addChild("span", new String[] { "title", "style" }, new String[] {
l10n("ipAddress"), "border-bottom: 1px dotted; cursor: help;" },
l10n("ipAddressTitle"));
}
- peerTableHeaderRow.addChild("th").addChild("a",
"href", container.fixLink(sortString(isReversed, "version"))).addChild("#",
l10n("versionTitle"));
+ peerTableHeaderRow.addChild("th").addChild("a",
"href", sortString(isReversed, "version")).addChild("#", l10n("versionTitle"));
if (mode >= PageMaker.MODE_ADVANCED) {
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "location"))).addChild("#",
"Location");
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "backoff"))).addChild("span", new
String[] { "title", "style" }, new String[] { "Other node busy? Display:
Percentage of time the node is overloaded, Current wait time remaining (0=not
overloaded)/total/last overload reason", "border-bottom: 1px dotted; cursor:
help;" }, "Backoff");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"location")).addChild("#", "Location");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"backoff")).addChild("span", new String[] { "title", "style" }, new String[] {
"Other node busy? Display: Percentage of time the node is overloaded, Current
wait time remaining (0=not overloaded)/total/last overload reason",
"border-bottom: 1px dotted; cursor: help;" }, "Backoff");
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "overload_p"))).addChild("span", new
String[] { "title", "style" }, new String[] { "Probability of the node
rejecting a request due to overload or causing a timeout.", "border-bottom: 1px
dotted; cursor: help;" }, "Overload Probability");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"overload_p")).addChild("span", new String[] { "title", "style" }, new String[]
{ "Probability of the node rejecting a request due to overload or causing a
timeout.", "border-bottom: 1px dotted; cursor: help;" }, "Overload
Probability");
}
- peerTableHeaderRow.addChild("th").addChild("a",
"href", container.fixLink(sortString(isReversed, "idle"))).addChild("span", new
String[] { "title", "style" }, new String[] { l10n("idleTime"), "border-bottom:
1px dotted; cursor: help;" }, l10n("idleTimeTitle"));
+ peerTableHeaderRow.addChild("th").addChild("a",
"href", sortString(isReversed, "idle")).addChild("span", new String[] {
"title", "style" }, new String[] { l10n("idleTime"), "border-bottom: 1px
dotted; cursor: help;" }, l10n("idleTimeTitle"));
if(hasPrivateNoteColumn())
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "privnote"))).addChild("span", new
String[] { "title", "style" }, new String[] { l10n("privateNote"),
"border-bottom: 1px dotted; cursor: help;" }, l10n("privateNoteTitle"));
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"privnote")).addChild("span", new String[] { "title", "style" }, new String[] {
l10n("privateNote"), "border-bottom: 1px dotted; cursor: help;" },
l10n("privateNoteTitle"));
if(mode >= PageMaker.MODE_ADVANCED) {
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "time_routable"))).addChild("#",
"%\u00a0Time Routable");
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed,
"selection_percentage"))).addChild("#", "%\u00a0Selection");
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "total_traffic"))).addChild("#",
"Total\u00a0Traffic\u00a0(in/out/resent)");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"time_routable")).addChild("#", "%\u00a0Time Routable");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"selection_percentage")).addChild("#", "%\u00a0Selection");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"total_traffic")).addChild("#", "Total\u00a0Traffic\u00a0(in/out/resent)");
peerTableHeaderRow.addChild("th",
"Congestion\u00a0Control");
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "time_delta"))).addChild("#",
"Time\u00a0Delta");
-
peerTableHeaderRow.addChild("th").addChild("a", "href",
container.fixLink(sortString(isReversed, "uptime"))).addChild("#",
"Reported\u00a0Uptime");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"time_delta")).addChild("#", "Time\u00a0Delta");
+
peerTableHeaderRow.addChild("th").addChild("a", "href", sortString(isReversed,
"uptime")).addChild("#", "Reported\u00a0Uptime");
}
SimpleColumn[] endCols = endColumnHeaders(mode
>= PageMaker.MODE_ADVANCED);
@@ -413,7 +413,7 @@
HTMLNode header =
peerTableHeaderRow.addChild("th");
String sortString =
col.getSortString();
if(sortString != null)
- header =
header.addChild("a", "href", container.fixLink(sortString(isReversed,
sortString)));
+ header =
header.addChild("a", "href", sortString(isReversed, sortString));
header.addChild("span", new
String[] { "title", "style" }, new String[] {
L10n.getString(col.getExplanationKey()), "border-bottom: 1px dotted; cursor:
help;" }, L10n.getString(col.getTitleKey()));
}
}
@@ -500,7 +500,7 @@
String pass = request.getPartAsString("formPassword", 32);
if((pass == null) || !pass.equals(core.formPassword)) {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink(defaultRedirectLocation()));
+ headers.put("Location", defaultRedirectLocation());
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
if(logMINOR) Logger.minor(this, "No password ("+pass+"
should be "+core.formPassword+ ')');
return;
@@ -608,7 +608,7 @@
}
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink(defaultRedirectLocation()));
+ headers.put("Location", defaultRedirectLocation());
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
} else handleAltPost(uri, request, ctx, logMINOR);
@@ -653,7 +653,7 @@
// FIXME better way to deal with this sort of thing???
L10n.addL10nSubstitution(headerReferenceInfobox,
"DarknetConnectionsToadlet.myReferenceHeader",
new String[] { "linkref", "/linkref",
"linktext", "/linktext" },
- new String[] { "<a
href=\""+container.fixLink(getURL()+"myref.fref")+"\">", "</a>", "<a
href=\""+container.fixLink(getURL()+"myref.txt")+"\">", "</a>" });
+ new String[] { "<a href=\"myref.fref\">",
"</a>", "<a href=\"myref.txt\">", "</a>" });
HTMLNode referenceInfoboxContent =
referenceInfobox.addChild("div", "class", "infobox-content");
HTMLNode warningSentence =
referenceInfoboxContent.addChild("p");
L10n.addL10nSubstitution(warningSentence,
"DarknetConnectionsToadlet.referenceCopyWarning",
@@ -888,6 +888,6 @@
}
private String sortString(boolean isReversed, String type) {
- return getURL() + (isReversed ? ("?sortBy="+type) :
("?sortBy="+type+"&reversed"));
+ return (isReversed ? ("?sortBy="+type) :
("?sortBy="+type+"&reversed"));
}
}
Modified: trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -64,12 +64,12 @@
/* add alert summary box */
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
- final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, container, request,
contentNode, "/connectivity/");
+ contentNode.addChild(core.alerts.createSummary(ctx));
+ final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, ctx, request, contentNode,
"/connectivity/");
// Add connection type box.
- node.ipDetector.addConnectionTypeBox(contentNode, container);
+ node.ipDetector.addConnectionTypeBox(contentNode, ctx);
UdpSocketHandler[] handlers = node.getPacketSocketHandlers();
Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -71,7 +71,7 @@
@Override
protected void drawNameColumn(HTMLNode peerRow, PeerNodeStatus
peerNodeStatus) {
// name column
- peerRow.addChild("td", "class", "peer-name").addChild("a",
"href", container.fixLink("/send_n2ntm/?peernode_hashcode=" +
peerNodeStatus.hashCode()), ((DarknetPeerNodeStatus)peerNodeStatus).getName());
+ peerRow.addChild("td", "class", "peer-name").addChild("a",
"href", "/send_n2ntm/?peernode_hashcode=" + peerNodeStatus.hashCode(),
((DarknetPeerNodeStatus)peerNodeStatus).getName());
}
@Override
@@ -214,6 +214,9 @@
}
}
redirectHere(ctx);
+ MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
+ headers.put("Location", container.fixLink("/friends/"));
+ ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
} else if (request.isPartSet("doAction") &&
request.getPartAsString("action",25).equals("set_burst_only")) {
//int hashcode =
Integer.decode(request.getParam("node")).intValue();
@@ -384,7 +387,7 @@
private void redirectHere(ToadletContext ctx) throws
ToadletContextClosedException, IOException {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location", container.fixLink("/friends/"));
+ headers.put("Location", "/friends/");
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
}
Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -103,27 +103,19 @@
String type = req.isPartSet("type") ?
req.getPartAsString("type", 30) : null;
boolean forceDownload = req.isPartSet("forcedownload");
String force = req.isPartSet("force") ?
req.getPartAsString("force", 30) : null;
- String key = req.isPartSet("key") ? req.getPartAsString("key",
1024) : null;
String pass = req.getPartAsString("formPassword", 32);
if ((pass.length() == 0) || !pass.equals(core.formPassword)) {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location", container.fixLink("/"));
+ headers.put("Location", ctx.fixLink("/"));
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
- if(maxSize != null || type != null || (!forceDownload) || force
!= null || key != null) {
+ if(maxSize != null || type != null || (!forceDownload) || force
!= null) {
StringBuffer sb = new StringBuffer();
boolean first = true;
- if(key != null) {
- if(!first) sb.append('&');
- sb.append("key=");
- sb.append(URLEncoder.encode(key, false));
- first = false;
- }
if(maxSize != null) {
- if(!first) sb.append('&');
sb.append("max-size=");
sb.append(URLEncoder.encode(maxSize, false));
first = false;
@@ -212,7 +204,7 @@
Bucket toFree = null;
try {
if((!force) && (!forceDownload)) {
- FilterOutput fo = ContentFilter.filter(data,
bucketFactory, mimeType, uri == null ? key.toURI(basePath) : uri,
container.enableInlinePrefetch() ? prefetchHook : null, container);
+ FilterOutput fo = ContentFilter.filter(data,
bucketFactory, mimeType, uri == null ? key.toURI(basePath) : uri,
container.enableInlinePrefetch() ? prefetchHook : null, ctx);
if(data != fo.data) toFree = fo.data;
data = fo.data;
mimeType = fo.type;
@@ -231,7 +223,7 @@
L10n.addL10nSubstitution(option,
"FProxyToadlet.openPossRSSAsPlainText", new String[] { "link", "/link", "bold",
"/bold" },
new String[] {
- "<a
href=\""+container.fixLink(basePath+key.toString()+"?type=text/plain&force="+getForceValue(key,now)+extrasNoMime)+"\">",
+ "<a
href=\""+ctx.fixLink(basePath+key.toString()+"?type=text/plain&force="+getForceValue(key,now)+extrasNoMime)+"\">",
"</a>",
"<b>",
"</b>" });
@@ -239,7 +231,7 @@
option = optionList.addChild("li");
L10n.addL10nSubstitution(option,
"FProxyToadlet.openPossRSSForceDisk", new String[] { "link", "/link", "bold",
"/bold" },
new String[] {
- "<a
href=\""+container.fixLink(basePath+key.toString()+"?forcedownload"+extras)+"\">",
+ "<a
href=\""+ctx.fixLink(basePath+key.toString()+"?forcedownload"+extras)+"\">",
"</a>",
"<b>",
"</b>" });
@@ -248,7 +240,7 @@
option =
optionList.addChild("li");
L10n.addL10nSubstitution(option, "FProxyToadlet.openRSSForce", new String[] {
"link", "/link", "bold", "/bold", "mime" },
new String[] {
- "<a
href=\""+container.fixLink(basePath+key.toString()+"?force="+getForceValue(key,
now)+extras)+"\">",
+ "<a
href=\""+ctx.fixLink(basePath+key.toString()+"?force="+getForceValue(key,
now)+extras)+"\">",
"</a>",
"<b>",
"</b>",
@@ -257,18 +249,18 @@
option = optionList.addChild("li");
L10n.addL10nSubstitution(option,
"FProxyToadlet.openRSSAsRSS", new String[] { "link", "/link", "bold", "/bold" },
new String[] {
- "<a
href=\""+container.fixLink(basePath + key.toString() +
"?type=application/xml+rss&force=" + getForceValue(key,
now)+extrasNoMime)+"\">",
+ "<a
href=\""+ctx.fixLink(basePath + key.toString() +
"?type=application/xml+rss&force=" + getForceValue(key,
now)+extrasNoMime)+"\">",
"</a>",
"<b>",
"</b>" });
if(referrer != null) {
option =
optionList.addChild("li");
L10n.addL10nSubstitution(option, "FProxyToadlet.backToReferrer", new String[] {
"link", "/link" },
- new String[] {
"<a href=\""+HTMLEncoder.encode(container.fixLink(referrer))+"\">", "</a>" });
+ new String[] {
"<a href=\""+HTMLEncoder.encode(ctx.fixLink(referrer))+"\">", "</a>" });
}
option = optionList.addChild("li");
L10n.addL10nSubstitution(option,
"FProxyToadlet.backToFProxy", new String[] { "link", "/link" },
- new String[] { "<a
href=\""+container.fixLink("/")+"\">", "</a>" });
+ new String[] { "<a
href=\""+ctx.fixLink("/")+"\">", "</a>" });
byte[] pageBytes =
pageNode.generate().getBytes("UTF-8");
context.sendReplyHeaders(200, "OK", new
MultiValueTable<String, String>(), "text/html; charset=utf-8",
pageBytes.length);
@@ -306,27 +298,27 @@
if((mimeType.equals("application/x-freenet-index")) &&
(core.node.pluginManager.isPluginLoaded("plugins.ThawIndexBrowser.ThawIndexBrowser")))
{
option = optionList.addChild("li");
- L10n.addL10nSubstitution(option,
"FProxyToadlet.openAsThawIndex", new String[] { "link", "/link" }, new String[]
{ "<b><a href=\""+container.fixLink(basePath +
"plugins/plugins.ThawIndexBrowser.ThawIndexBrowser/?key=" + key.toString()) +
"\">", "</a></b>" });
+ L10n.addL10nSubstitution(option,
"FProxyToadlet.openAsThawIndex", new String[] { "link", "/link" }, new String[]
{ "<b><a href=\""+ctx.fixLink(basePath +
"plugins/plugins.ThawIndexBrowser.ThawIndexBrowser/?key=" + key.toString()) +
"\">", "</a></b>" });
}
option = optionList.addChild("li");
// FIXME: is this safe? See bug #131
- L10n.addL10nSubstitution(option,
"FProxyToadlet.openAsText", new String[] { "link", "/link" }, new String[] {
"<a
href=\""+container.fixLink(basePath+key.toString()+"?type=text/plain"+extrasNoMime)+"\">",
"</a>" });
+ L10n.addL10nSubstitution(option,
"FProxyToadlet.openAsText", new String[] { "link", "/link" }, new String[] {
"<a
href=\""+ctx.fixLink(basePath+key.toString()+"?type=text/plain"+extrasNoMime)+"\">",
"</a>" });
option = optionList.addChild("li");
- L10n.addL10nSubstitution(option,
"FProxyToadlet.openForceDisk", new String[] { "link", "/link" }, new String[] {
"<a
href=\""+container.fixLink(basePath+key.toString()+"?forcedownload"+extras)+"\">",
"</a>" });
+ L10n.addL10nSubstitution(option,
"FProxyToadlet.openForceDisk", new String[] { "link", "/link" }, new String[] {
"<a
href=\""+ctx.fixLink(basePath+key.toString()+"?forcedownload"+extras)+"\">",
"</a>" });
if(!(mimeType.equals("application/octet-stream") ||
mimeType.equals("application/x-msdownload"))) {
option = optionList.addChild("li");
- L10n.addL10nSubstitution(option,
"FProxyToadlet.openForce", new String[] { "link", "/link", "mime" }, new
String[] { "<a href=\""+container.fixLink(basePath + key.toString() + "?force="
+ getForceValue(key, now)+extras)+"\">", "</a>", HTMLEncoder.encode(mimeType)});
+ L10n.addL10nSubstitution(option,
"FProxyToadlet.openForce", new String[] { "link", "/link", "mime" }, new
String[] { "<a href=\""+ctx.fixLink(basePath + key.toString() + "?force=" +
getForceValue(key, now)+extras)+"\">", "</a>", HTMLEncoder.encode(mimeType)});
}
if(referrer != null) {
option = optionList.addChild("li");
L10n.addL10nSubstitution(option,
"FProxyToadlet.backToReferrer", new String[] { "link", "/link" },
- new String[] { "<a
href=\""+HTMLEncoder.encode(container.fixLink(referrer))+"\">", "</a>" });
+ new String[] { "<a
href=\""+HTMLEncoder.encode(ctx.fixLink(referrer))+"\">", "</a>" });
}
option = optionList.addChild("li");
L10n.addL10nSubstitution(option,
"FProxyToadlet.backToFProxy", new String[] { "link", "/link" },
- new String[] { "<a
href=\""+container.fixLink("/")+"\">", "</a>" });
+ new String[] { "<a
href=\""+ctx.fixLink("/")+"\">", "</a>" });
if(ctx.isAllowedFullAccess() ||
!container.publicGatewayMode()) {
option = optionList.addChild("li");
HTMLNode optionForm = ctx.addFormChild(option,
"/queue/", "tooBigQueueForm");
@@ -502,7 +494,7 @@
errorContent.addChild("br");
errorContent.addChild(ctx.getPageMaker().createBackLink(ctx, l10n("goBack")));
errorContent.addChild("br");
- addHomepageLink(errorContent, container);
+ addHomepageLink(errorContent, ctx);
this.writeHTMLReply(ctx, 400, l10n("invalidKeyTitle"),
pageNode.generate());
return;
@@ -536,7 +528,7 @@
if(Logger.shouldLog(Logger.MINOR, this))
Logger.minor(this, "Failed to fetch "+uri+" :
"+e);
if(e.newURI != null) {
- Toadlet.writePermanentRedirect(ctx, msg, '/'
+e.newURI.toASCIIString() + override);
+ Toadlet.writePermanentRedirect(ctx, msg,
ctx.fixLink('/' +e.newURI.toASCIIString() + override));
} else if(e.mode == FetchException.TOO_BIG) {
HTMLNode pageNode =
ctx.getPageMaker().getPageNode(l10n("fileInformationTitle"), ctx);
HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
@@ -547,7 +539,7 @@
HTMLNode fileInformationList =
infoboxContent.addChild("ul");
HTMLNode option =
fileInformationList.addChild("li");
option.addChild("#", (l10n("filenameLabel") + '
'));
- option.addChild("a", "href",
container.fixLink('/' + key.toString()), getFilename(e, key,
e.getExpectedMimeType()));
+ option.addChild("a", "href", ctx.fixLink('/' +
key.toString()), getFilename(e, key, e.getExpectedMimeType()));
String mime =
writeSizeAndMIME(fileInformationList, e);
@@ -572,7 +564,7 @@
optionForm.addChild("input", new
String[] { "type", "name", "value" }, new String[] { "submit", "download",
l10n("downloadInBackgroundToDisk") });
}
- optionList.addChild("li").addChild("a", new
String[] { "href", "title" }, new String[] { container.fixLink("/"),
L10n.getString("Toadlet.homepage") }, l10n("abortToHomepage"));
+ optionList.addChild("li").addChild("a", new
String[] { "href", "title" }, new String[] { ctx.fixLink("/"),
L10n.getString("Toadlet.homepage") }, l10n("abortToHomepage"));
option = optionList.addChild("li");
option.addChild(ctx.getPageMaker().createBackLink(ctx, l10n("goBackToPrev")));
@@ -588,7 +580,7 @@
HTMLNode fileInformationList =
infoboxContent.addChild("ul");
HTMLNode option =
fileInformationList.addChild("li");
option.addChild("#", (l10n("filenameLabel") + '
'));
- option.addChild("a", "href",
container.fixLink('/' + key.toString()), getFilename(e, key,
e.getExpectedMimeType()));
+ option.addChild("a", "href", ctx.fixLink('/' +
key.toString()), getFilename(e, key, e.getExpectedMimeType()));
String mime =
writeSizeAndMIME(fileInformationList, e);
infobox.addChild("div", "class",
"infobox-header", l10n("explanationTitle"));
@@ -608,7 +600,7 @@
if((e.mode == FetchException.NOT_IN_ARCHIVE) &&
(core.node.pluginManager.isPluginLoaded("plugins.KeyExplorer.KeyExplorer"))) {
option = optionList.addChild("li");
- L10n.addL10nSubstitution(option,
"FProxyToadlet.openWithKeyExplorer", new String[] { "link", "/link" }, new
String[] { "<a
href=\""+container.fixLink("/plugins/plugins.KeyExplorer.KeyExplorer/?key=" +
key.toString()) + "\">", "</a>" });
+ L10n.addL10nSubstitution(option,
"FProxyToadlet.openWithKeyExplorer", new String[] { "link", "/link" }, new
String[] { "<a
href=\""+ctx.fixLink("/plugins/plugins.KeyExplorer.KeyExplorer/?key=" +
key.toString()) + "\">", "</a>" });
}
if(!e.isFatal() && (ctx.isAllowedFullAccess()
|| !container.publicGatewayMode())) {
@@ -623,10 +615,10 @@
optionForm.addChild("input", new
String[] { "type", "name", "value" }, new String[] { "submit", "download",
l10n("downloadInBackgroundToDisk")});
optionList.addChild("li").
- addChild("a", "href",
container.fixLink(getLink(key, requestedMimeType, maxSize,
httprequest.getParam("force", null),
httprequest.isParameterSet("forcedownload")))).addChild("#", l10n("retryNow"));
+ addChild("a", "href",
ctx.fixLink(getLink(key, requestedMimeType, maxSize,
httprequest.getParam("force", null),
httprequest.isParameterSet("forcedownload")))).addChild("#", l10n("retryNow"));
}
- optionList.addChild("li").addChild("a", new
String[] { "href", "title" }, new String[] { container.fixLink("/"),
L10n.getString("Toadlet.homepage") }, l10n("abortToHomepage"));
+ optionList.addChild("li").addChild("a", new
String[] { "href", "title" }, new String[] { ctx.fixLink("/"),
L10n.getString("Toadlet.homepage") }, l10n("abortToHomepage"));
option = optionList.addChild("li");
option.addChild(ctx.getPageMaker().createBackLink(ctx, l10n("goBackToPrev")));
Modified: trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -42,7 +42,6 @@
SECURITY_NETWORK,
SECURITY_FRIENDS,
SECURITY_PHYSICAL,
- HISTORY_CLOAKING,
NAME_SELECTION,
BANDWIDTH,
DATASTORE_SIZE,
@@ -147,32 +146,6 @@
form.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "submit", "cancel",
L10n.getString("Toadlet.cancel")});
this.writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
return;
- } else if(currentStep == WIZARD_STEP.HISTORY_CLOAKING) {
- HTMLNode pageNode =
ctx.getPageMaker().getPageNode(l10n("historyCloakingPageTitle"), false, ctx);
- HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
-
- HTMLNode infobox = contentNode.addChild("div", "class",
"infobox infobox-normal");
- HTMLNode infoboxHeader = infobox.addChild("div",
"class", "infobox-header");
- HTMLNode infoboxContent = infobox.addChild("div",
"class", "infobox-content");
-
- infoboxHeader.addChild("#",
l10n("historyCloakingPageTitle"));
- infoboxContent.addChild("p",
l10n("historyCloakingIntro"));
-
- HTMLNode form = ctx.addFormChild(infoboxContent, ".",
"historyCloakingForm");
- HTMLNode input = form.addChild("p").addChild("input",
new String[] { "type", "name", "value", "checked" }, new String[] { "radio",
"cloaking", "true", "checked" });
- input.addChild("#", l10n("enableHistoryCloaking"));
- input.addChild("#", " ");
- input.addChild("b",
l10n("enableHistoryCloakingWarning"));
-
- input = form.addChild("p").addChild("input", new
String[] { "type", "name", "value" }, new String[] { "radio", "cloaking",
"false" });
- input.addChild("#", l10n("disableHistoryCloaking"));
- input.addChild("#", " ");
- input.addChild("b",
l10n("disableHistoryCloakingWarning"));
-
- form.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "submit", "historyCloakingF",
L10n.getString("FirstTimeWizardToadlet.continue")});
- form.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "submit", "cancel",
L10n.getString("Toadlet.cancel")});
- this.writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
- return;
} else if(currentStep == WIZARD_STEP.NAME_SELECTION) {
// Attempt to skip one step if possible: opennet nodes
don't need a name
if(Boolean.valueOf(request.getParam("opennet"))) {
@@ -317,7 +290,7 @@
congratzInfoboxHeader.addChild("#", l10n("congratz"));
congratzInfoboxContent.addChild("p",
l10n("congratzLong"));
- congratzInfoboxContent.addChild("a", "href",
container.fixLink(TOADLET_URL+"?step="+WIZARD_STEP.FINAL),
L10n.getString("FirstTimeWizardToadlet.continueEnd"));
+ congratzInfoboxContent.addChild("a", "href",
"?step="+WIZARD_STEP.FINAL,
L10n.getString("FirstTimeWizardToadlet.continueEnd"));
this.writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
return;
@@ -343,10 +316,10 @@
HTMLNode firstParagraph = welcomeInfoboxContent.addChild("p");
firstParagraph.addChild("#", l10n("welcomeInfoboxContent1"));
HTMLNode secondParagraph = welcomeInfoboxContent.addChild("p");
- secondParagraph.addChild("a", "href",
container.fixLink(TOADLET_URL+"?step="+WIZARD_STEP.SECURITY_NETWORK)).addChild("#",
L10n.getString("FirstTimeWizardToadlet.clickContinue"));
+ secondParagraph.addChild("a", "href",
"?step="+WIZARD_STEP.SECURITY_NETWORK).addChild("#",
L10n.getString("FirstTimeWizardToadlet.clickContinue"));
HTMLNode thirdParagraph = welcomeInfoboxContent.addChild("p");
- thirdParagraph.addChild("a", "href",
container.fixLink(TOADLET_URL+"?step="+WIZARD_STEP.FINAL)).addChild("#",
l10n("skipWizard"));
+ thirdParagraph.addChild("a", "href",
"?step="+WIZARD_STEP.FINAL).addChild("#", l10n("skipWizard"));
this.writeHTMLReply(ctx, 200, "OK", pageNode.generate());
}
@@ -473,16 +446,6 @@
}
core.node.securityLevels.setThreatLevel(newThreatLevel);
core.storeConfig();
- super.writeTemporaryRedirect(ctx, "step1",
TOADLET_URL+"?step="+WIZARD_STEP.HISTORY_CLOAKING+"&opennet="+core.node.isOpennetEnabled());
- return;
- } else if(request.isPartSet("historyCloakingF")) {
- String value = request.getPartAsString("cloaking", 10);
- try {
-
config.get("fproxy").set("enableHistoryCloaking", value);
- Logger.normal(this, "History cloaking has been
set to "+ value);
- } catch (ConfigException e) {
- Logger.error(this, "Should not happen, please
report!" + e, e);
- }
super.writeTemporaryRedirect(ctx, "step1",
TOADLET_URL+"?step="+WIZARD_STEP.NAME_SELECTION+"&opennet="+core.node.isOpennetEnabled());
return;
} else if(request.isPartSet("nnameF")) {
Modified: trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -36,8 +36,6 @@
this.core = core;
}
- static final String URL = "/files/";
-
/**
* @see freenet.clients.http.Toadlet#handleGet(java.net.URI,
* freenet.clients.http.ToadletContext)
@@ -62,7 +60,7 @@
if (currentPath == null) {
currentPath = new
File(System.getProperty("user.home"));
}
- writePermanentRedirect(toadletContext, "Found", URL +
"?path=" + URLEncoder.encode(currentPath.getAbsolutePath(),true)+extra);
+ writePermanentRedirect(toadletContext, "Found",
"?path=" + URLEncoder.encode(currentPath.getAbsolutePath(),true)+extra);
return;
}
@@ -78,7 +76,7 @@
HTMLNode pageNode = pageMaker.getPageNode(l10n("listingTitle",
"path", currentPath.getAbsolutePath()), toadletContext);
HTMLNode contentNode = pageMaker.getContentNode(pageNode);
if(toadletContext.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
+
contentNode.addChild(core.alerts.createSummary(toadletContext));
HTMLNode infoboxDiv = contentNode.addChild("div", "class",
"infobox");
infoboxDiv.addChild("div", "class", "infobox-header",
l10n("listing", "path", currentPath.getAbsolutePath()));
@@ -109,7 +107,7 @@
HTMLNode rootRow = listingTable.addChild("tr");
rootRow.addChild("td");
HTMLNode rootLinkCellNode =
rootRow.addChild("td");
- rootLinkCellNode.addChild("a", "href",
container.fixLink(URL+"?path=" +
URLEncoder.encode(currentRoot.getCanonicalPath(),false)+extra),
currentRoot.getCanonicalPath());
+ rootLinkCellNode.addChild("a", "href", "?path="
+ URLEncoder.encode(currentRoot.getCanonicalPath(),false)+extra,
currentRoot.getCanonicalPath());
rootRow.addChild("td");
}
/* add back link */
@@ -117,7 +115,7 @@
HTMLNode backlinkRow =
listingTable.addChild("tr");
backlinkRow.addChild("td");
HTMLNode backlinkCellNode =
backlinkRow.addChild("td");
- backlinkCellNode.addChild("a", "href",
container.fixLink(URL+"?path=" +
URLEncoder.encode(currentPath.getParent(),false)+extra), "..");
+ backlinkCellNode.addChild("a", "href", "?path="
+ URLEncoder.encode(currentPath.getParent(),false)+extra, "..");
backlinkRow.addChild("td");
}
for (int fileIndex = 0, fileCount = files.length;
fileIndex < fileCount; fileIndex++) {
@@ -132,7 +130,7 @@
if(furi != null)
formNode.addChild("input", new String[] { "type", "name", "value" }, new
String[] { "hidden", "key", furi.toASCIIString() });
HTMLNode directoryCellNode =
fileRow.addChild("td");
- directoryCellNode.addChild("a",
"href", container.fixLink(URL+"?path=" +
URLEncoder.encode(currentFile.getAbsolutePath(),false)+extra),
currentFile.getName());
+ directoryCellNode.addChild("a",
"href", "?path=" +
URLEncoder.encode(currentFile.getAbsolutePath(),false)+extra,
currentFile.getName());
} else {
fileRow.addChild("td");
fileRow.addChild("td", "class",
"unreadable-file", currentFile.getName());
Modified: trunk/freenet/src/freenet/clients/http/N2NTMToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/N2NTMToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/N2NTMToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -74,7 +74,7 @@
if (peernode_name == null) {
contentNode.addChild(createPeerInfobox("infobox-error",
l10n("peerNotFoundTitle"),
l10n("peerNotFoundWithHash",
- "hash",
input_hashcode_string), container));
+ "hash",
input_hashcode_string), ctx));
this.writeHTMLReply(ctx, 200, "OK", pageNode
.generate());
return;
@@ -86,7 +86,7 @@
return;
}
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location", container.fixLink("/friends/"));
+ headers.put("Location", "/friends/");
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
}
@@ -100,7 +100,7 @@
}
private static HTMLNode createPeerInfobox(String infoboxType,
- String header, String message, LinkFixer ctx) {
+ String header, String message, ToadletContext ctx) {
HTMLNode infobox = new HTMLNode("div", "class", "infobox "
+ infoboxType);
infobox.addChild("div", "class", "infobox-header", header);
@@ -110,7 +110,7 @@
HTMLNode list = infoboxContent.addChild("ul");
Toadlet.addHomepageLink(list, ctx);
list.addChild("li").addChild("a", new String[] { "href",
"title" },
- new String[] { ctx.fixLink("/friends/"),
l10n("returnToFriends") },
+ new String[] { "/friends/",
l10n("returnToFriends") },
l10n("friends"));
return infobox;
}
@@ -122,7 +122,7 @@
String pass = request.getPartAsString("formPassword", 32);
if ((pass == null) || !pass.equals(core.formPassword)) {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink("/send_n2ntm/"));
+ headers.put("Location", "/send_n2ntm/");
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
@@ -153,7 +153,7 @@
filename = new File(fnam);
if(!(filename.exists() && filename.canRead())) {
peerTableInfobox.addChild("#",
l10n("noSuchFileOrCannotRead"));
-
Toadlet.addHomepageLink(peerTableInfobox, container);
+
Toadlet.addHomepageLink(peerTableInfobox, ctx);
this.writeHTMLReply(ctx, 400, "OK",
pageNode.generate());
return;
}
@@ -174,7 +174,7 @@
status =
pn.sendFileOffer(filename, message);
} catch (IOException e) {
peerTableInfobox.addChild("#", l10n("noSuchFileOrCannotRead"));
-
Toadlet.addHomepageLink(peerTableInfobox, container);
+
Toadlet.addHomepageLink(peerTableInfobox, ctx);
this.writeHTMLReply(ctx, 200, "OK", pageNode.generate());
return;
}
@@ -221,15 +221,15 @@
"n2ntm-message-text");
infoboxContent.addChild("#", message);
HTMLNode list = peerTableInfobox.addChild("ul");
- Toadlet.addHomepageLink(list, container);
+ Toadlet.addHomepageLink(list, ctx);
list.addChild("li").addChild("a", new String[] {
"href", "title" },
- new String[] {
container.fixLink("/friends/"), l10n("returnToFriends") },
+ new String[] { "/friends/",
l10n("returnToFriends") },
l10n("friends"));
this.writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
return;
}
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location", container.fixLink("/friends/"));
+ headers.put("Location", "/friends/");
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
}
Deleted: trunk/freenet/src/freenet/clients/http/NullToadletContainer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/NullToadletContainer.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/NullToadletContainer.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -1,89 +0,0 @@
-package freenet.clients.http;
-
-import java.net.InetAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import freenet.clients.http.PageMaker.THEME;
-import freenet.support.HTMLNode;
-import freenet.support.URLEncodedFormatException;
-import freenet.support.api.BucketFactory;
-
-public class NullToadletContainer implements ToadletContainer {
-
- public static NullToadletContainer instance = new
NullToadletContainer();
-
- public HTMLNode addFormChild(HTMLNode parentNode, String target, String
id) {
- HTMLNode formNode =
- parentNode.addChild("form", new String[] { "action",
"method", "enctype", "id", "accept-charset" },
- new String[] { target, "post",
"multipart/form-data", id, "utf-8"} ).addChild("div");
-
- return formNode;
- }
-
- public boolean allowPosts() {
- return false;
- }
-
- public boolean doRobots() {
- return false;
- }
-
- public boolean enableInlinePrefetch() {
- return false;
- }
-
- public boolean enablePersistentConnections() {
- return false;
- }
-
- public Toadlet findToadlet(URI uri) throws PermanentRedirectException {
- return null;
- }
-
- public String generateSID(String realPath) throws
URLEncodedFormatException {
- return null;
- }
-
- public BucketFactory getBucketFactory() {
- return null;
- }
-
- public String getFormPassword() {
- return null;
- }
-
- public THEME getTheme() {
- return null;
- }
-
- public boolean isAllowedFullAccess(InetAddress remoteAddr) {
- return false;
- }
-
- public boolean isSecureIDCheckingDisabled() {
- return true;
- }
-
- public boolean publicGatewayMode() {
- return false;
- }
-
- public void register(Toadlet t, String urlPrefix, boolean atFront,
- boolean fullAccessOnly) {
- throw new UnsupportedOperationException();
- }
-
- public String fixLink(String orig) {
- return orig;
- }
-
- public URI fixLink(URI uri) throws URISyntaxException {
- return uri;
- }
-
- public boolean enableActivelinks() {
- return false;
- }
-
-}
Modified: trunk/freenet/src/freenet/clients/http/PageMaker.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PageMaker.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/PageMaker.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -75,20 +75,17 @@
private final FredPluginL10n plugin;
private final boolean pluginMode;
- private final LinkFixer fixer;
- public PageMaker(FredPluginL10n plug, THEME t, LinkFixer fixer) {
+ public PageMaker(FredPluginL10n plug, THEME t) {
setTheme(t);
plugin = plug;
pluginMode = true;
- this.fixer = fixer;
}
- protected PageMaker(THEME t, LinkFixer fixer) {
+ protected PageMaker(THEME t) {
setTheme(t);
plugin = null;
pluginMode = false;
- this.fixer = fixer;
}
void setOverride(File f) {
@@ -143,19 +140,18 @@
public HTMLNode getPageNode(String title, boolean
renderNavigationLinks, ToadletContext ctx) {
boolean fullAccess = ctx == null ? false :
ctx.isAllowedFullAccess();
- LinkFixer fixer = ctx == null ? this.fixer : ctx.getContainer();
HTMLNode pageNode = new HTMLNode.HTMLDoctype("html",
"-//W3C//DTD XHTML 1.1//EN");
HTMLNode htmlNode = pageNode.addChild("html", "xml:lang",
L10n.getSelectedLanguage().isoCode);
HTMLNode headNode = htmlNode.addChild("head");
headNode.addChild("meta", new String[] { "http-equiv",
"content" }, new String[] { "Content-Type", "text/html; charset=utf-8" });
headNode.addChild("title", title + " - Freenet");
if(override == null)
- headNode.addChild("link", new String[] { "rel", "href",
"type", "title" }, new String[] { "stylesheet", fixer.fixLink("/static/themes/"
+ theme.code + "/theme.css"), "text/css", theme.code });
+ headNode.addChild("link", new String[] { "rel", "href",
"type", "title" }, new String[] { "stylesheet", ctx.fixLink("/static/themes/" +
theme.code + "/theme.css"), "text/css", theme.code });
else
headNode.addChild(getOverrideContent());
for (THEME t: THEME.values()) {
String themeName = t.code;
- headNode.addChild("link", new String[] { "rel", "href",
"type", "media", "title" }, new String[] { "alternate stylesheet",
fixer.fixLink("/static/themes/" + themeName + "/theme.css"), "text/css",
"screen", themeName });
+ headNode.addChild("link", new String[] { "rel", "href",
"type", "media", "title" }, new String[] { "alternate stylesheet",
ctx.fixLink("/static/themes/" + themeName + "/theme.css"), "text/css",
"screen", themeName });
}
HTMLNode bodyNode = htmlNode.addChild("body");
@@ -172,9 +168,9 @@
String navigationPath =
navigationLinks.get(navigationLink);
HTMLNode listItem = navbarUl.addChild("li");
if (plugin != null)
- listItem.addChild("a", new String[] {
"href", "title" }, new String[] { fixer.fixLink(navigationPath),
plugin.getString(navigationTitle) }, plugin.getString(navigationLink));
+ listItem.addChild("a", new String[] {
"href", "title" }, new String[] { ctx.fixLink(navigationPath),
plugin.getString(navigationTitle) }, plugin.getString(navigationLink));
else
- listItem.addChild("a", new String[] {
"href", "title" }, new String[] { fixer.fixLink(navigationPath),
L10n.getString(navigationTitle) }, L10n.getString(navigationLink));
+ listItem.addChild("a", new String[] {
"href", "title" }, new String[] { ctx.fixLink(navigationPath),
L10n.getString(navigationTitle) }, L10n.getString(navigationLink));
}
}
HTMLNode contentDiv = pageDiv.addChild("div", "id", "content");
Modified: trunk/freenet/src/freenet/clients/http/PproxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PproxyToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/PproxyToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -52,7 +52,7 @@
String pass = request.getPartAsString("formPassword", 32);
if((pass == null) || !pass.equals(core.formPassword)) {
- headers.put("Location", container.fixLink("/plugins/"));
+ headers.put("Location", "/plugins/");
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
@@ -124,7 +124,7 @@
String pluginName = null;
pluginName =
request.getPartAsString("plugin-name", 40);
pm.startPluginOfficial(pluginName, true);
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", ".");
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
return;
}
@@ -136,7 +136,7 @@
pm.startPluginFile(pluginName, true);
else
pm.startPluginURL(pluginName, true);
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", ".");
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
return;
}
@@ -144,19 +144,19 @@
String pluginName = null;
pluginName =
request.getPartAsString("plugin-uri", 300);
pm.startPluginFreenet(pluginName, true);
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", ".");
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
return;
}
if (request.isPartSet("dismiss-user-alert")) {
int userAlertHashCode =
request.getIntPart("disable", -1);
core.alerts.dismissAlert(userAlertHashCode);
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", ".");
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
return;
}
if (request.isPartSet("cancel")){
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", "/plugins/");
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
return;
}
@@ -174,7 +174,7 @@
HTMLNode infoboxContent =
infobox.addChild("div", "class", "infobox-content");
infoboxContent.addChild("#",
l10n("pluginUnloadedWithName", "name", pluginThreadName));
infoboxContent.addChild("br");
- infoboxContent.addChild("a", "href",
container.fixLink("/plugins/"), l10n("returnToPluginPage"));
+ infoboxContent.addChild("a", "href",
"/plugins/", l10n("returnToPluginPage"));
writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
return;
}if (request.getPartAsString("unload",
MAX_PLUGIN_NAME_LENGTH).length() > 0) {
@@ -231,13 +231,13 @@
// FIXME
pm.startPluginAuto(fn, true);
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", ".");
ctx.sendReplyHeaders(302, "Found",
headers, null, 0);
}
return;
}else {
// Ignore
- headers.put("Location",
container.fixLink("/plugins/"));
+ headers.put("Location", ".");
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
}
@@ -307,13 +307,13 @@
}
HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
-
contentNode.addChild(core.alerts.createSummary(container));
+
contentNode.addChild(core.alerts.createSummary(ctx));
UserAlert[] userAlerts =
core.alerts.getAlerts();
for (int index = 0, count = userAlerts.length;
index < count; index++) {
UserAlert userAlert = userAlerts[index];
if (userAlert.isValid() &&
(userAlert.getUserIdentifier() == PluginManager.class)) {
-
contentNode.addChild(core.alerts.renderAlert(userAlert, container));
+
contentNode.addChild(core.alerts.renderAlert(userAlert, ctx));
}
}
@@ -422,23 +422,26 @@
headerRow.addChild("th", l10n("startedAtTitle"));
headerRow.addChild("th");
headerRow.addChild("th");
+ headerRow.addChild("th");
Iterator<PluginInfoWrapper> it =
pm.getPlugins().iterator();
while (it.hasNext()) {
PluginInfoWrapper pi = it.next();
HTMLNode pluginRow = pluginTable.addChild("tr");
- if(pi.isPproxyPlugin()) {
- // FIXME a title = click on me to visit
the plugin???
- pluginRow.addChild("td").addChild("a",
"href", container.fixLink("/plugins/"+pi.getPluginClassName()),
pi.getPluginClassName());
- } else {
- pluginRow.addChild("td",
pi.getPluginClassName());
- }
+ pluginRow.addChild("td",
pi.getPluginClassName());
pluginRow.addChild("td", pi.getPluginVersion());
pluginRow.addChild("td", pi.getThreadName());
pluginRow.addChild("td", new
Date(pi.getStarted()).toString());
if (pi.isStopping()) {
pluginRow.addChild("td",
l10n("pluginStopping"));
+ /* add two empty cells. */
pluginRow.addChild("td");
+ pluginRow.addChild("td");
} else {
+ if (pi.isPproxyPlugin()) {
+ HTMLNode visitForm =
pluginRow.addChild("td").addChild("form", new String[] { "method", "action",
"target" }, new String[] { "get", pi.getPluginClassName(), "_blank" });
+ visitForm.addChild("input", new
String[] { "type", "name", "value" }, new String[] { "hidden", "formPassword",
core.formPassword });
+ visitForm.addChild("input", new
String[] { "type", "value" }, new String[] { "submit",
L10n.getString("PluginToadlet.visit") });
+ }
HTMLNode unloadForm =
ctx.addFormChild(pluginRow.addChild("td"), ".", "unloadPluginForm");
unloadForm.addChild("input", new
String[] { "type", "name", "value" }, new String[] { "hidden", "unload",
pi.getThreadName() });
unloadForm.addChild("input", new
String[] { "type", "value" }, new String[] { "submit", l10n("unload") });
Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -75,8 +75,6 @@
private static final int MAX_TYPE_LENGTH = 1024;
static final int MAX_KEY_LENGTH = 1024*1024;
- private static final String URL = "/queue/";
-
private NodeClientCore core;
final FCPServer fcp;
@@ -128,7 +126,7 @@
}
MultiValueTable<String, String> responseHeaders
= new MultiValueTable<String, String>();
- responseHeaders.put("Location",
container.fixLink("/files/?key="+insertURI.toASCIIString()));
+ responseHeaders.put("Location",
ctx.fixLink("/files/?key="+insertURI.toASCIIString()));
ctx.sendReplyHeaders(302, "Found",
responseHeaders, null, 0);
return;
}
@@ -136,7 +134,7 @@
String pass = request.getPartAsString("formPassword",
32);
if ((pass.length() == 0) ||
!pass.equals(core.formPassword)) {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink("/queue/"));
+ headers.put("Location", ctx.fixLink("/queue/"));
ctx.sendReplyHeaders(302, "Found", headers,
null, 0);
if(logMINOR) Logger.minor(this, "No
formPassword: "+pass);
return;
@@ -169,7 +167,7 @@
}
}
fcp.forceStorePersistentRequests();
- writePermanentRedirect(ctx, "Done", "/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
return;
} else if(request.isPartSet("remove_AllRequests") &&
(request.getPartAsString("remove_AllRequests", 32).length() > 0)) {
@@ -198,7 +196,7 @@
new
String[]{ failedIdentifiers.toString() }
));
else
- writePermanentRedirect(ctx, "Done",
container.fixLink("/queue/"));
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
fcp.forceStorePersistentRequests();
return;
}else if(request.isPartSet("download")) {
@@ -226,13 +224,13 @@
this.writeError(L10n.getString("QueueToadlet.errorDToDisk"),
L10n.getString("QueueToadlet.errorDToDiskConfig"), ctx);
return;
}
- writePermanentRedirect(ctx, "Done", "/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
return;
}else if(request.isPartSet("bulkDownloads")) {
String bulkDownloadsAsString =
request.getPartAsString("bulkDownloads", Integer.MAX_VALUE);
String[] keys =
bulkDownloadsAsString.split("\n");
if(("".equals(bulkDownloadsAsString)) ||
(keys.length < 1)) {
- writePermanentRedirect(ctx, "Done",
"/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
return;
}
LinkedList<String> success = new
LinkedList<String>(), failure = new LinkedList<String>();
@@ -279,7 +277,7 @@
}
failureDiv.addChild("br");
}
- alertContent.addChild("a", "href",
container.fixLink("/queue/"), L10n.getString("Toadlet.returnToQueuepage"));
+ alertContent.addChild("a", "href",
ctx.fixLink("/queue/"), L10n.getString("Toadlet.returnToQueuepage"));
writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
return;
} else if (request.isPartSet("change_priority")) {
@@ -293,7 +291,7 @@
break loop;
}
}
- writePermanentRedirect(ctx, "Done", "/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
fcp.forceStorePersistentRequests();
return;
} else if (request.getPartAsString("insert",
128).length() > 0) {
@@ -343,7 +341,7 @@
writeError(L10n.getString("QueueToadlet.errorInvalidURI"),
L10n.getString("QueueToadlet.errorInvalidURIToU"), ctx);
return;
}
- writePermanentRedirect(ctx, "Done", "/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
return;
} else if (request.isPartSet("insert-local-file")) {
String filename =
request.getPartAsString("filename", MAX_FILENAME_LENGTH);
@@ -381,7 +379,7 @@
this.writeError(L10n.getString("QueueToadlet.errorAccessDenied"),
L10n.getString("QueueToadlet.errorAccessDeniedFile", new String[]{ "file" },
new String[]{ file.getName() }), ctx);
return;
}
- writePermanentRedirect(ctx, "Done", "/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
return;
} else if (request.isPartSet("insert-local-dir")) {
String filename =
request.getPartAsString("filename", MAX_FILENAME_LENGTH);
@@ -412,7 +410,7 @@
this.writeError(L10n.getString("QueueToadlet.errorNoFileOrCannotRead"),
L10n.getString("QueueToadlet.errorAccessDeniedFile", new String[]{ "file" },
new String[]{ file.toString() }), ctx);
return;
}
- writePermanentRedirect(ctx, "Done", "/queue/");
+ writePermanentRedirect(ctx, "Done",
ctx.fixLink("/queue/"));
return;
} else if (request.isPartSet("get")) {
String identifier =
request.getPartAsString("identifier", MAX_IDENTIFIER_LENGTH);
@@ -474,12 +472,12 @@
HTMLNode pageNode = pageMaker.getPageNode(header, context);
HTMLNode contentNode = pageMaker.getContentNode(pageNode);
if(context.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
+
contentNode.addChild(core.alerts.createSummary(context));
HTMLNode infobox =
contentNode.addChild(pageMaker.getInfobox("infobox-error", header));
HTMLNode infoboxContent = pageMaker.getContentNode(infobox);
infoboxContent.addChild("#", message);
if(returnToQueuePage)
- infoboxContent.addChild("div").addChildren(new
HTMLNode[] { new HTMLNode("#", "Return to "), new HTMLNode("a", "href",
container.fixLink("/queue/"), "queue page"), new HTMLNode("#", ".") });
+ infoboxContent.addChild("div").addChildren(new
HTMLNode[] { new HTMLNode("#", "Return to "), new HTMLNode("a", "href",
"/queue/", "queue page"), new HTMLNode("#", ".") });
writeHTMLReply(context, 400, "Bad request",
pageNode.generate());
}
@@ -556,7 +554,7 @@
HTMLNode contentNode =
pageMaker.getContentNode(pageNode);
/* add alert summary box */
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
+
contentNode.addChild(core.alerts.createSummary(ctx));
HTMLNode infobox =
contentNode.addChild(pageMaker.getInfobox("infobox-information",
L10n.getString("QueueToadlet.globalQueueIsEmpty")));
HTMLNode infoboxContent =
pageMaker.getContentNode(infobox);
infoboxContent.addChild("#",
L10n.getString("QueueToadlet.noTaskOnGlobalQueue"));
@@ -674,8 +672,8 @@
/* add alert summary box */
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
- final int mode = pageMaker.drawModeSelectionArray(core,
container, request, contentNode, "/queue/");
+ contentNode.addChild(core.alerts.createSummary(ctx));
+ final int mode = pageMaker.drawModeSelectionArray(core, ctx,
request, contentNode, "/queue/");
/* add file insert box */
contentNode.addChild(createInsertBox(pageMaker, ctx, mode >=
PageMaker.MODE_ADVANCED));
@@ -987,7 +985,7 @@
private HTMLNode createIdentifierCell(FreenetURI uri, String
identifier, boolean directory, ToadletContext ctx) {
HTMLNode identifierCell = new HTMLNode("td", "class",
"request-identifier");
if (uri != null) {
- identifierCell.addChild("span", "class",
"identifier_with_uri").addChild("a", "href", container.fixLink("/" + uri +
(directory ? "/" : "")), identifier);
+ identifierCell.addChild("span", "class",
"identifier_with_uri").addChild("a", "href", ctx.fixLink("/" + uri + (directory
? "/" : "")), identifier);
} else {
identifierCell.addChild("span", "class",
"identifier_without_uri", identifier);
}
@@ -1008,7 +1006,7 @@
private HTMLNode createDownloadCell(PageMaker pageMaker, ClientGet p,
ToadletContext ctx) {
HTMLNode downloadCell = new HTMLNode("td", "class",
"request-download");
- downloadCell.addChild("a", "href",
container.fixLink("/queue/"+p.getURI().toString()),
L10n.getString("QueueToadlet.download"));
+ downloadCell.addChild("a", "href",
ctx.fixLink("/queue/"+p.getURI().toString()),
L10n.getString("QueueToadlet.download"));
return downloadCell;
}
@@ -1035,7 +1033,7 @@
private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash,
ToadletContext ctx) {
HTMLNode keyCell = new HTMLNode("td", "class", "request-key");
if (uri != null) {
- keyCell.addChild("span", "class",
"key_is").addChild("a", "href", container.fixLink('/' + uri.toString() +
(addSlash ? "/" : "")), uri.toShortString() + (addSlash ? "/" : ""));
+ keyCell.addChild("span", "class",
"key_is").addChild("a", "href", ctx.fixLink('/' + uri.toString() + (addSlash ?
"/" : "")), uri.toShortString() + (addSlash ? "/" : ""));
} else {
keyCell.addChild("span", "class", "key_unknown",
L10n.getString("QueueToadlet.unknown"));
}
@@ -1095,9 +1093,9 @@
for (int columnIndex = 0, columnCount = columns.length;
columnIndex < columnCount; columnIndex++) {
int column = columns[columnIndex];
if (column == LIST_IDENTIFIER) {
- headerRow.addChild("th").addChild("a", "href",
container.fixLink(URL + (isReversed ? "?sortBy=id" :
"?sortBy=id&reversed"))).addChild("#",
L10n.getString("QueueToadlet.identifier"));
+ headerRow.addChild("th").addChild("a", "href",
ctx.fixLink((isReversed ? "?sortBy=id" : "?sortBy=id&reversed"))).addChild("#",
L10n.getString("QueueToadlet.identifier"));
} else if (column == LIST_SIZE) {
- headerRow.addChild("th").addChild("a", "href",
container.fixLink(URL + (isReversed ? "?sortBy=size" :
"?sortBy=size&reversed"))).addChild("#", L10n.getString("QueueToadlet.size"));
+ headerRow.addChild("th").addChild("a", "href",
ctx.fixLink((isReversed ? "?sortBy=size" :
"?sortBy=size&reversed"))).addChild("#", L10n.getString("QueueToadlet.size"));
} else if (column == LIST_DOWNLOAD) {
headerRow.addChild("th",
L10n.getString("QueueToadlet.download"));
} else if (column == LIST_MIME_TYPE) {
@@ -1109,13 +1107,13 @@
} else if (column == LIST_FILENAME) {
headerRow.addChild("th",
L10n.getString("QueueToadlet.fileName"));
} else if (column == LIST_PRIORITY) {
- headerRow.addChild("th").addChild("a", "href",
container.fixLink(URL + (isReversed ? "?sortBy=priority" :
"?sortBy=priority&reversed"))).addChild("#",
L10n.getString("QueueToadlet.priority"));
+ headerRow.addChild("th").addChild("a", "href",
ctx.fixLink((isReversed ? "?sortBy=priority" :
"?sortBy=priority&reversed"))).addChild("#",
L10n.getString("QueueToadlet.priority"));
} else if (column == LIST_FILES) {
headerRow.addChild("th",
L10n.getString("QueueToadlet.files"));
} else if (column == LIST_TOTAL_SIZE) {
headerRow.addChild("th",
L10n.getString("QueueToadlet.totalSize"));
} else if (column == LIST_PROGRESS) {
- headerRow.addChild("th").addChild("a", "href",
container.fixLink(URL + (isReversed ? "?sortBy=progress" :
"?sortBy=progress&reversed"))).addChild("#",
L10n.getString("QueueToadlet.progress"));
+ headerRow.addChild("th").addChild("a", "href",
ctx.fixLink((isReversed ? "?sortBy=progress" :
"?sortBy=progress&reversed"))).addChild("#",
L10n.getString("QueueToadlet.progress"));
} else if (column == LIST_REASON) {
headerRow.addChild("th",
L10n.getString("QueueToadlet.reason"));
}
Modified: trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -34,7 +34,7 @@
HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
+ contentNode.addChild(core.alerts.createSummary(ctx));
// Description infobox
HTMLNode helpScreenBox1 =
contentNode.addChild(ctx.getPageMaker().getInfobox("infobox-content",
L10n.getString("SimpleHelpToadlet.descriptionTitle")));
Modified: trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -554,7 +554,7 @@
if((cssName.indexOf(':') != -1) || (cssName.indexOf('/') != -1))
throw new InvalidConfigValueException("CSS name must
not contain slashes or colons!");
cssTheme = THEME.themeFromName(cssName);
- pageMaker = new PageMaker(cssTheme, this);
+ pageMaker = new PageMaker(cssTheme);
if(!fproxyConfig.getOption("CSSOverride").isDefault()) {
cssOverride = new
File(fproxyConfig.getString("CSSOverride"));
@@ -832,16 +832,6 @@
return bf;
}
- /** How long should the secureid= be? We don't want the URLs to be
really long...
- * One attempt requires the attacker to modify the DOM, trigger a
relayout, and then
- * read the link color out of the DOM. Relayout can be batched, but if
it's too big
- * it gets really slow and the user notices... The lookup is done to
determine whether
- * to display this element. A miss results in no relayout. Maybe this
could be
- * optimised down to hundreds of cycles ... in practice it's probably a
lot more than
- * that. Hopefully by the time probing 96 bits is feasible, browsers
will turn off
- * history probing by default! */
- static final int SID_LENGTH_BYTES = 12;
-
public String generateSID(String realPath) throws
URLEncodedFormatException {
MessageDigest md = SHA256.getMessageDigest();
realPath = prepareForSID(realPath);
@@ -852,10 +842,8 @@
}
md.update(clientNonce);
byte[] output = md.digest();
- byte[] finalOutput = new byte[SID_LENGTH_BYTES];
- System.arraycopy(output, 0, finalOutput, 0, SID_LENGTH_BYTES);
SHA256.returnMessageDigest(md);
- return Base64.encode(finalOutput);
+ return Base64.encode(output);
}
private String prepareForSID(String realPath) throws
URLEncodedFormatException {
@@ -904,14 +892,6 @@
public String fixLink(String orig) {
if(isSecureIDCheckingDisabled())
return orig;
- if(!orig.startsWith("/")) {
- Logger.error(this, "fixLink() on relative URI: "+orig,
new Exception("debug"));
- }
- if((orig.indexOf("?secureid=") > -1) ||
- (orig.indexOf("?") > -1 &&
orig.substring(orig.indexOf("?")).indexOf("&secureid=") > -1)) {
- Logger.error(this, "Already has a secureid: "+orig);
- return orig;
- }
String toSign = orig;
String frag = "";
int hashIndex = toSign.indexOf('#');
Modified: trunk/freenet/src/freenet/clients/http/StaticToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StaticToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/StaticToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -68,9 +68,7 @@
if(mimeType.equals("text/css")) {
// Easiest way to fix the links is just to pass it
through the content filter.
- FilterOutput fo = ContentFilter.filter(data,
ctx.getBucketFactory(), mimeType, uri, null, container);
- if(data != fo.data)
- data.free();
+ FilterOutput fo = ContentFilter.filter(data,
ctx.getBucketFactory(), mimeType, uri, null, ctx);
data = fo.data;
}
Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -150,8 +150,8 @@
final long nodeUptimeSeconds = (now - node.startupTime) / 1000;
if(ctx.isAllowedFullAccess())
-
contentNode.addChild(core.alerts.createSummary(container));
- final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, container, request,
contentNode, "/stats/");
+ contentNode.addChild(core.alerts.createSummary(ctx));
+ final int mode =
ctx.getPageMaker().drawModeSelectionArray(core, ctx, request, contentNode,
"/stats/");
double swaps = node.getSwaps();
double noSwaps = node.getNoSwaps();
@@ -184,8 +184,8 @@
// Get logs
HTMLNode logsList = statGatheringContent.addChild("ul");
if(nodeConfig.config.get("logger").getBoolean("enabled"))
- logsList.addChild("li").addChild("a", new String[]{
"href", "target"}, new String[]{ container.fixLink("/?latestlog"), "_blank"},
l10n("getLogs"));
- logsList.addChild("li").addChild("a", "href",
container.fixLink(TranslationToadlet.TOADLET_URL+"?getOverrideTranlationFile")).addChild("#",
L10n.getString("TranslationToadlet.downloadTranslationsFile"));
+ logsList.addChild("li").addChild("a", new String[]{
"href", "target"}, new String[]{ "/?latestlog", "_blank"}, l10n("getLogs"));
+ logsList.addChild("li").addChild("a", "href",
TranslationToadlet.TOADLET_URL+"?getOverrideTranlationFile").addChild("#",
L10n.getString("TranslationToadlet.downloadTranslationsFile"));
if(mode >= PageMaker.MODE_ADVANCED) {
// store size box
Modified: trunk/freenet/src/freenet/clients/http/Toadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/Toadlet.java 2009-01-21 12:45:23 UTC
(rev 25181)
+++ trunk/freenet/src/freenet/clients/http/Toadlet.java 2009-01-21 13:45:28 UTC
(rev 25182)
@@ -171,7 +171,7 @@
static void writePermanentRedirect(ToadletContext ctx, String msg,
String location) throws ToadletContextClosedException, IOException {
MultiValueTable<String, String> mvt = new
MultiValueTable<String, String>();
- mvt.put("Location", ctx.getContainer().fixLink(location));
+ mvt.put("Location", location);
if(msg == null) msg = "";
else msg = HTMLEncoder.encode(msg);
String redirDoc =
@@ -190,7 +190,7 @@
protected void writeTemporaryRedirect(ToadletContext ctx, String msg,
String location) throws ToadletContextClosedException, IOException {
MultiValueTable<String, String> mvt = new
MultiValueTable<String, String>();
- mvt.put("Location", container.fixLink(location));
+ mvt.put("Location", location);
if(msg == null) msg = "";
else msg = HTMLEncoder.encode(msg);
String redirDoc =
@@ -228,7 +228,7 @@
infoboxContent.addChild("br");
infoboxContent.addChild("a", "href", ".",
l10n("returnToPrevPage"));
infoboxContent.addChild("br");
- addHomepageLink(infoboxContent, container);
+ addHomepageLink(infoboxContent, ctx);
writeHTMLReply(ctx, code, desc, pageNode.generate());
}
@@ -259,7 +259,7 @@
infoboxContent.addChild("pre", sw.toString());
infoboxContent.addChild("br");
infoboxContent.addChild("a", "href", ".",
l10n("returnToPrevPage"));
- addHomepageLink(infoboxContent, container);
+ addHomepageLink(infoboxContent, ctx);
writeHTMLReply(ctx, 500, desc, pageNode.generate());
}
@@ -276,8 +276,8 @@
writeHTMLReply(ctx, 500, "Internal Error", msg);
}
- protected static void addHomepageLink(HTMLNode content, LinkFixer
fixer) {
- content.addChild("a", new String[]{"href", "title"}, new
String[]{fixer.fixLink("/"), l10n("homepage")}, l10n("returnToNodeHomepage"));
+ protected static void addHomepageLink(HTMLNode content, ToadletContext
ctx) {
+ content.addChild("a", new String[]{"href", "title"}, new
String[]{ctx.fixLink("/"), l10n("homepage")}, l10n("returnToNodeHomepage"));
}
/**
Modified: trunk/freenet/src/freenet/clients/http/ToadletContext.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ToadletContext.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/ToadletContext.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -12,7 +12,7 @@
* Object represents context for a single request. Is used as a token,
* when the Toadlet wants to e.g. write a reply.
*/
-public interface ToadletContext {
+public interface ToadletContext extends LinkFixer {
/**
* Write reply headers.
@@ -85,5 +85,13 @@
boolean doRobots();
ToadletContainer getContainer();
+
+ /**
+ * Add a valid ?sessionid= to a link
+ * @param string
+ * @param string2
+ * @return
+ */
+ String fixLink(String orig);
}
Modified: trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -441,7 +441,7 @@
return false;
}
String path = uri.getRawPath();
- String secureid = req.getParam("secureid");
+ String secureid = req.getParam("secureid"); // remove it
String queries = getQueriesNoSecureID(uri);
String realPath = path;
if(queries != null) realPath += queries;
@@ -450,7 +450,6 @@
expectedSecureID = ctx.container.generateSID(realPath);
} catch (URLEncodedFormatException e1) {
ctx.sendError(400, "Bad Request",
l10n("invalidURICheckingSecureID"), false, null);
- req.freeParts();
return true;
}
if(secureid != null && expectedSecureID.equals(secureid)) {
@@ -465,13 +464,7 @@
HTMLNode warningBoxHeader = warningBox.addChild("div", "class",
"infobox-header");
warningBoxHeader.addChild("#", l10n("browserHistoryWarningBoxTitle"));
HTMLNode warningBoxContent = warningBox.addChild("div", "class",
"infobox-content");
- HTMLNode firstPara = warningBoxContent.addChild("p");
- L10n.addL10nSubstitution(firstPara,
"ToadletContextImpl.browserHistoryWarning", new String[] { "bold", "/bold" },
new String[] { "<b>", "</b>" });
- if(secureid == null || secureid.length() == 0)
- firstPara.addChild("#", " " +
l10n("browserHistoryWarningNoSecureID"));
- else
- firstPara.addChild("#", " " +
l10n("browserHistoryWarningInvalidSecureID"));
- warningBoxContent.addChild("p").addChild("b",
l10n("browserHistoryWarningEmptyHistory"));
+ warningBoxContent.addChild("p", l10n("browserHistoryWarning"));
// Link to the page
if(queries == null) queries = "?secureid="+expectedSecureID;
@@ -482,10 +475,8 @@
new String[] { "<a
href=\""+HTMLEncoder.encode(realPath)+"\">", "</a>" });
if(ctx.isAllowedFullAccess()) {
- warningBoxContent.addChild("p",
l10n("browserHistoryWarningCanDisable"));
- HTMLNode formNode = ctx.addFormChild(warningBoxContent,
"/config/", "turnOffHistoryCloaking");
- formNode.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "hidden", "fproxy.enableHistoryCloaking", "false" });
- formNode.addChild("input", new String[] { "type", "value" },
new String[] { "submit", l10n("browserHistoryWarningDisableButton") });
+ // Button to disable the warning
+ // FIXME implement
}
byte[] data;
@@ -497,7 +488,7 @@
ctx.sendReplyHeaders(400, "Bad Request", null, "text/html;
charset=utf-8", data.length);
ctx.writeData(data);
- req.freeParts();
+
return true;
}
Modified: trunk/freenet/src/freenet/clients/http/TranslationToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/TranslationToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/TranslationToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -79,11 +79,11 @@
);
HTMLNode footer = translationNode.addChild("div",
"class", "warning");
- footer.addChild("a", "href",
container.fixLink(TOADLET_URL+"?getOverrideTranlationFile")).addChild("#",
l10n("downloadTranslationsFile"));
+ footer.addChild("a", "href",
TOADLET_URL+"?getOverrideTranlationFile").addChild("#",
l10n("downloadTranslationsFile"));
footer.addChild("%", " ");
- footer.addChild("a", "href",
container.fixLink(TOADLET_URL+"?translate="+key+ (showEverything ? "" :
"&toTranslateOnly"))).addChild("#", l10n("reEdit"));
+ footer.addChild("a", "href",
TOADLET_URL+"?translate="+key+ (showEverything ? "" :
"&toTranslateOnly")).addChild("#", l10n("reEdit"));
footer.addChild("%", " ");
- footer.addChild("a", "href",
container.fixLink(TOADLET_URL + (showEverything ? "" :
"?toTranslateOnly"))).addChild("#", l10n("returnToTranslations"));
+ footer.addChild("a", "href", TOADLET_URL +
(showEverything ? "" : "?toTranslateOnly")).addChild("#",
l10n("returnToTranslations"));
this.writeHTMLReply(ctx, 200, "OK",
pageNode.generate());
return;
@@ -159,12 +159,12 @@
HTMLNode translationNode = contentNode.addChild("div", "class",
"translation");
HTMLNode translationHeaderNode = translationNode.addChild("p");
translationHeaderNode.addChild("#",
l10n("contributingToLabelWithLang", "lang",
L10n.getSelectedLanguage().fullName));
- translationHeaderNode.addChild("a", "href",
container.fixLink(TOADLET_URL+"?getOverrideTranlationFile")).addChild("#",
l10n("downloadTranslationsFile"));
+ translationHeaderNode.addChild("a", "href",
ctx.fixLink(TOADLET_URL+"?getOverrideTranlationFile")).addChild("#",
l10n("downloadTranslationsFile"));
translationHeaderNode.addChild("#", " ");
if(showEverything)
- translationHeaderNode.addChild("a", "href",
container.fixLink(TOADLET_URL+"?toTranslateOnly")).addChild("#",
l10n("hideAlreadyTranslated"));
+ translationHeaderNode.addChild("a", "href",
ctx.fixLink(TOADLET_URL+"?toTranslateOnly")).addChild("#",
l10n("hideAlreadyTranslated"));
else
- translationHeaderNode.addChild("a", "href",
container.fixLink(TOADLET_URL)).addChild("#", l10n("showEverything"));
+ translationHeaderNode.addChild("a", "href",
ctx.fixLink(TOADLET_URL)).addChild("#", l10n("showEverything"));
HTMLNode legendTable = translationNode.addChild("table",
"class", "translation");
HTMLNode legendRow = legendTable.addChild("tr");
@@ -188,7 +188,7 @@
L10n.getDefaultString(key)
);
- contentRow.addChild("td", "class",
"translation-new").addChild(_setOrRemoveOverride(key, isOverriden,
showEverything, container));
+ contentRow.addChild("td", "class",
"translation-new").addChild(_setOrRemoveOverride(key, isOverriden,
showEverything, ctx));
}
}
@@ -245,7 +245,7 @@
private void redirectTo(ToadletContext ctx, String target) throws
ToadletContextClosedException, IOException {
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location", container.fixLink(target));
+ headers.put("Location", ctx.fixLink(target));
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
Modified: trunk/freenet/src/freenet/clients/http/UserAlertsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/UserAlertsToadlet.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/UserAlertsToadlet.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -43,7 +43,7 @@
HTMLNode pageNode =
ctx.getPageMaker().getPageNode(l10n("titleWithName", "name", node.getMyName()),
ctx);
HTMLNode contentNode = ctx.getPageMaker().getContentNode(pageNode);
- contentNode.addChild(alerts.createAlerts(container));
+ contentNode.addChild(alerts.createAlerts(ctx));
writeHTMLReply(ctx, 200, "OK", pageNode.generate());
}
Modified: trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -51,12 +51,12 @@
void redirectToRoot(ToadletContext ctx) throws
ToadletContextClosedException, IOException {
MultiValueTable<String, String> headers = new MultiValueTable<String,
String>();
- headers.put("Location", container.fixLink("/"));
+ headers.put("Location", ctx.fixLink("/"));
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
- private void addCategoryToList(BookmarkCategory cat, HTMLNode list,
boolean noActiveLinks, LinkFixer ctx) {
+ private void addCategoryToList(BookmarkCategory cat, HTMLNode list,
boolean noActiveLinks, ToadletContext ctx) {
List<BookmarkItem> items = cat.getItems();
if (items.size() > 0) {
// FIXME CSS noborder ...
@@ -126,7 +126,7 @@
if ((request.getPartAsString("Go", 32).length() > 0)) {
url =
request.getPartAsString(GenericReadFilterCallback.magicHTTPEscapeString,
MAX_URL_LENGTH);
}
- headers.put("Location", container.fixLink(url == null ? "/" :
url));
+ headers.put("Location", url == null ? "/" : url);
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
} else if (request.getPartAsString("update", 32).length() > 0) {
HTMLNode pageNode =
ctx.getPageMaker().getPageNode(l10n("nodeUpdateConfirmTitle"), ctx);
@@ -289,7 +289,7 @@
}
}
content.addChild("br");
- addHomepageLink(content, container);
+ addHomepageLink(content, ctx);
writeHTMLReply(ctx, 200, "OK", pageNode.generate());
request.freeParts();
@@ -344,7 +344,7 @@
}
content.addChild("br");
- addHomepageLink(content, container);
+ addHomepageLink(content, ctx);
writeHTMLReply(ctx, 200, "OK", pageNode.generate());
request.freeParts();
@@ -366,7 +366,7 @@
return;
}
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink("/?terminated&formPassword=" + core.formPassword));
+ headers.put("Location", ctx.fixLink("/?terminated&formPassword=" +
core.formPassword));
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
node.ps.queueTimedJob(new Runnable() {
@@ -393,7 +393,7 @@
}
MultiValueTable<String, String> headers = new
MultiValueTable<String, String>();
- headers.put("Location",
container.fixLink("/?restarted&formPassword=" + core.formPassword));
+ headers.put("Location", ctx.fixLink("/?restarted&formPassword=" +
core.formPassword));
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
node.ps.queueTimedJob(new Runnable() {
@@ -548,7 +548,7 @@
// Alerts
if (ctx.isAllowedFullAccess()) {
-
contentNode.addChild(core.alerts.createAlertsShort(l10n("alertsSummary"),
advancedModeOutputEnabled, true, container));
+
contentNode.addChild(core.alerts.createAlertsShort(l10n("alertsSummary"),
advancedModeOutputEnabled, true, ctx));
}
// Search Box
@@ -578,7 +578,7 @@
bookmarkBoxHeader.addChild("#",
L10n.getString("BookmarkEditorToadlet.myBookmarksTitle"));
if (ctx.isAllowedFullAccess()) {
bookmarkBoxHeader.addChild("#", " [");
- bookmarkBoxHeader.addChild("span", "id",
"bookmarkedit").addChild("a", new String[]{"href", "class"}, new
String[]{container.fixLink("/bookmarkEditor/"), "interfacelink"},
L10n.getString("BookmarkEditorToadlet.edit"));
+ bookmarkBoxHeader.addChild("span", "id",
"bookmarkedit").addChild("a", new String[]{"href", "class"}, new
String[]{ctx.fixLink("/bookmarkEditor/"), "interfacelink"},
L10n.getString("BookmarkEditorToadlet.edit"));
bookmarkBoxHeader.addChild("#", "]");
}
@@ -586,13 +586,13 @@
HTMLNode bookmarksList = bookmarkBoxContent.addChild("ul", "id",
"bookmarks");
- addCategoryToList(BookmarkManager.MAIN_CATEGORY, bookmarksList,
(!container.enableActivelinks()) || (useragent != null &&
useragent.contains("khtml") && !useragent.contains("chrome")), container);
+ addCategoryToList(BookmarkManager.MAIN_CATEGORY, bookmarksList,
(!container.enableActivelinks()) || (useragent != null &&
useragent.contains("khtml") && !useragent.contains("chrome")), ctx);
// Fetch-a-key box
HTMLNode fetchKeyBox =
contentNode.addChild(ctx.getPageMaker().getInfobox("infobox-normal",
l10n("fetchKeyLabel")));
HTMLNode fetchKeyContent =
ctx.getPageMaker().getContentNode(fetchKeyBox);
fetchKeyContent.addAttribute("id", "keyfetchbox");
- HTMLNode fetchKeyForm = ctx.addFormChild(fetchKeyContent, "/",
"fetchKeyForm").addChild("div");
+ HTMLNode fetchKeyForm = fetchKeyContent.addChild("form", new
String[]{"action", "method"}, new String[]{"/", "get"}).addChild("div");
fetchKeyForm.addChild("#", l10n("keyRequestLabel") + ' ');
fetchKeyForm.addChild("input", new String[]{"type", "size", "name"},
new String[]{"text", "80", "key"});
fetchKeyForm.addChild("input", new String[]{"type", "value"}, new
String[]{"submit", l10n("fetch")});
Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.clients.http.bookmark;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.keys.FreenetURI;
import freenet.keys.USK;
import freenet.l10n.L10n;
@@ -83,7 +82,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode n = new HTMLNode("div");
L10n.addL10nSubstitution(n,
"BookmarkItem.bookmarkUpdatedWithLink", new String[]{"link", "/link", "name",
"edition"},
new String[]{"<a href=\"" +
fixer.fixLink("/"+key.toString()) + "\">", "</a>", HTMLEncoder.encode(name),
Long.toString(key.getSuggestedEdition())});
Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2009-01-21
13:45:28 UTC (rev 25182)
@@ -279,12 +279,6 @@
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.historyCloakingPageTitle=Enable browser history
cloaking?
-FirstTimeWizardToadlet.historyCloakingIntro=Most web browsers are susceptible
to "history stealing" attacks. This means that websites you visit can check
your browser history for known URLs (even with javascript turned off). The best
solution is to use a separate browser to access Freenet, which you never use to
access the Internet itself. However, your accesses to Freenet can be hidden by
the Freenet web interface adding a short random string to the address of the
freenet pages you fetch. Should this be enabled?
-FirstTimeWizardToadlet.enableHistoryCloaking=Yes, enable history cloaking
(RECOMMENDED).
-FirstTimeWizardToadlet.enableHistoryCloakingWarning=When you copy keys from
Freenet, always remove the ?secureid= from the end of the address before giving
it to anyone else!
-FirstTimeWizardToadlet.disableHistoryCloaking=No, disable history cloaking.
-FirstTimeWizardToadlet.disableHistoryCloakingWarning=Only turn history
cloaking off if you use a separate browser for Freenet.
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
@@ -1281,15 +1275,10 @@
Toadlet.unauthorizedTitle=Unauthorized
Toadlet.unauthorized=You are not permitted access to this page.
Toadlet.homepage=Homepage
-ToadletContextImpl.browserHistoryWarningTitle=Warning: Possible information
leak!
-ToadletContextImpl.browserHistoryWarningBoxTitle=Warning: Possible information
leak!
-ToadletContextImpl.browserHistoryWarning=You just followed a link, or entered
a URL, which did not include a valid ?secureid= parameter. This means that this
request ${bold} is in your browser history${/bold}, and could be read by any
website you visit!
-ToadletContextImpl.browserHistoryWarningInvalidSecureID=This particular
request seems to have been copied from another node: if a hostile site knows
this URI it can probe your history for it.
-ToadletContextImpl.browserHistoryWarningNoSecureID=You may have copied a URL
directly into the location bar: this is dangerous, please do not do this unless
you have taken appropriate precautions (see below). If you want to visit a
specific freenet key please use the Fetch a Key box on the homepage.
-ToadletContextImpl.browserHistoryWarningEmptyHistory=Please empty your browser
history!
+ToadletContextImpl.browserHistoryWarningTitle=Warning: Browser history problem!
+ToadletContextImpl.browserHistoryWarningBoxTitle=Warning: Browser history
problem!
+ToadletContextImpl.browserHistoryWarning=You just followed a link, or entered
a URL, which did not include a valid ?secureid= parameter. This means that this
request is in your browser history, and can be read by any website you visit!
Please empty your browser history. If you will frequently enter URLs by hand,
you should use a dedicated browser for Freenet.
ToadletContextImpl.browserHistoryWarningLink=Click ${link}here${/link} to go
to the page you requested.
-ToadletContextImpl.browserHistoryWarningCanDisable=If you never use the same
browser for Freenet as for the web, if you always have privacy mode enabled, or
if you don't care about websites knowing which freesites you have visited, you
can turn off this warning:
-ToadletContextImpl.browserHistoryWarningDisableButton=Disable this warning
(READ WARNING FIRST!)
ToadletContextImpl.cannotParseContentLength=Content-length parse error:
${error}
ToadletContextImpl.cannotParseContentLengthWithError=Cannot parse the
content-length: ${error}
ToadletContextImpl.headersLineTooLong=Line too long parsing headers
Modified: trunk/freenet/src/freenet/node/Announcer.java
===================================================================
--- trunk/freenet/src/freenet/node/Announcer.java 2009-01-21 12:45:23 UTC
(rev 25181)
+++ trunk/freenet/src/freenet/node/Announcer.java 2009-01-21 13:45:28 UTC
(rev 25182)
@@ -17,7 +17,6 @@
import java.util.Vector;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.io.comm.PeerParseException;
import freenet.io.comm.ReferenceSignatureVerificationException;
import freenet.l10n.L10n;
@@ -544,7 +543,7 @@
return L10n.getString("UserAlert.hide");
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("#", getText());
}
Modified: trunk/freenet/src/freenet/node/DarknetPeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/DarknetPeerNode.java 2009-01-21 12:45:23 UTC
(rev 25181)
+++ trunk/freenet/src/freenet/node/DarknetPeerNode.java 2009-01-21 13:45:28 UTC
(rev 25182)
@@ -17,7 +17,6 @@
import freenet.client.DefaultMIMETypes;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.crypt.BlockCipher;
import freenet.io.comm.DMT;
import freenet.io.comm.DisconnectedException;
@@ -939,7 +938,7 @@
return L10n.getString("UserAlert.hide");
}
@Override
- public HTMLNode getHTMLText(ToadletContainer
fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
div.addChild("p",
l10n("failedReceiveHeader", new String[] { "filename", "node" },
@@ -1050,7 +1049,7 @@
return L10n.getString("UserAlert.hide");
}
@Override
- public HTMLNode getHTMLText(ToadletContainer
fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
// FIXME localise!!!
@@ -1164,7 +1163,7 @@
return null; // Cannot hide, but can
reject
}
@Override
- public HTMLNode getHTMLText(ToadletContainer
fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
div.addChild("p",
l10n("offeredFileHeader", "name", getName()));
Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -13,7 +13,6 @@
import net.i2p.util.NativeBigInteger;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.crypt.BlockCipher;
import freenet.crypt.DSA;
import freenet.crypt.DSAGroup;
@@ -2694,7 +2693,7 @@
return l10n("somePeersDisconnectedStillNotAcked",
"count", Integer.toString(sz));
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
Peer[] peers;
synchronized(peersWithProblems) {
Modified: trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
===================================================================
--- trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -8,7 +8,6 @@
import java.util.Vector;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.clients.http.filter.GenericReadFilterCallback;
import freenet.io.AddressTracker;
import freenet.io.comm.FreenetInetAddress;
@@ -54,7 +53,7 @@
return L10n.getString("UserAlert.hide");
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
String url =
GenericReadFilterCallback.escapeURL(HTMLEncoder.encode(l10n("portForwardHelpURL")));
boolean maybeForwarded = true;
@@ -190,7 +189,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
div.addChild("#", super.getText());
if(suggestPortForward) {
@@ -935,7 +934,7 @@
return plugins.length > 0;
}
- public void addConnectionTypeBox(HTMLNode contentNode, ToadletContainer
ctx) {
+ public void addConnectionTypeBox(HTMLNode contentNode, LinkFixer ctx) {
if(node.clientCore == null) return;
if(node.clientCore.alerts == null) return;
if(proxyAlert.isValid())
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2009-01-21 12:45:23 UTC (rev
25181)
+++ trunk/freenet/src/freenet/node/Node.java 2009-01-21 13:45:28 UTC (rev
25182)
@@ -1850,7 +1850,7 @@
.getString("Node.storeSaltHashMigratedShort"), UserAlert.MINOR) {
@Override
- public HTMLNode
getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer
fixer) {
HTMLNode div = new
HTMLNode("div");
div.addChild("#",
L10n.getString("Node.storeSaltHashMigrated"));
HTMLNode ul =
div.addChild("ul");
@@ -2351,7 +2351,7 @@
clientCore.alerts.register(new
AbstractUserAlert(false, null, null, null, null, UserAlert.ERROR, true, null,
false, null) {
@Override
- public HTMLNode
getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer
fixer) {
HTMLNode n = new
HTMLNode("div");
L10n.addL10nSubstitution(n,
"Node.buggyJVMWithLink",
new String[] {
"link", "/link", "version" },
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2009-01-21 12:45:23 UTC
(rev 25181)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2009-01-21 13:45:28 UTC
(rev 25182)
@@ -10,7 +10,6 @@
import java.util.Map;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.config.InvalidConfigValueException;
import freenet.config.SubConfig;
import freenet.io.comm.FreenetInetAddress;
@@ -575,7 +574,7 @@
node.clientCore.alerts.register(invalidAddressOverrideAlert);
}
- public void addConnectionTypeBox(HTMLNode contentNode, ToadletContainer
ctx) {
+ public void addConnectionTypeBox(HTMLNode contentNode, LinkFixer ctx) {
ipDetectorManager.addConnectionTypeBox(contentNode, ctx);
}
Modified: trunk/freenet/src/freenet/node/PacketSender.java
===================================================================
--- trunk/freenet/src/freenet/node/PacketSender.java 2009-01-21 12:45:23 UTC
(rev 25181)
+++ trunk/freenet/src/freenet/node/PacketSender.java 2009-01-21 13:45:28 UTC
(rev 25182)
@@ -14,7 +14,6 @@
import org.tanukisoftware.wrapper.WrapperManager;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.io.comm.Peer;
import freenet.l10n.L10n;
import freenet.node.useralerts.UserAlert;
@@ -476,7 +475,7 @@
return l10n("somePeersDisconnectedBlockedTooLong",
"count", Integer.toString(sz));
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
Peer[] peers;
synchronized(peersDumpedBlockedTooLong) {
Modified: trunk/freenet/src/freenet/node/SecurityLevels.java
===================================================================
--- trunk/freenet/src/freenet/node/SecurityLevels.java 2009-01-21 12:45:23 UTC
(rev 25181)
+++ trunk/freenet/src/freenet/node/SecurityLevels.java 2009-01-21 13:45:28 UTC
(rev 25182)
@@ -8,8 +8,6 @@
import freenet.clients.http.ConfigToadlet;
import freenet.clients.http.LinkFixer;
import freenet.clients.http.NullLinkFixer;
-import freenet.clients.http.NullToadletContainer;
-import freenet.clients.http.ToadletContainer;
import freenet.config.EnumerableOptionCallback;
import freenet.config.InvalidConfigValueException;
import freenet.config.NodeNeedRestartException;
@@ -408,7 +406,7 @@
return L10n.getString("UserAlert.hide");
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
HTMLNode ul = div.addChild("ul");
ul.addChild("li",
l10n("userAlertNetworkThreatLevel", "level",
localisedName(networkThreatLevel)));
@@ -434,7 +432,7 @@
}
public String getText() {
- return
getHTMLText(NullToadletContainer.instance).getContent();
+ return
getHTMLText(NullLinkFixer.instance).getContent();
}
public String getTitle() {
Modified: trunk/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -28,7 +28,6 @@
import freenet.client.async.ClientPutter;
import freenet.client.async.SimpleBlockSet;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.io.comm.AsyncMessageCallback;
import freenet.io.comm.DMT;
import freenet.io.comm.DisconnectedException;
@@ -541,7 +540,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode div = new HTMLNode("div");
div.addChild("p").addChild("#", l10n("intro"));
Modified: trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -18,7 +18,7 @@
package freenet.node.useralerts;
-import freenet.clients.http.ToadletContainer;
+import freenet.clients.http.LinkFixer;
import freenet.support.HTMLNode;
/**
@@ -94,7 +94,7 @@
/**
* {@inheritDoc}
*/
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return htmlText;
}
Modified: trunk/freenet/src/freenet/node/useralerts/BuildOldAgeUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/BuildOldAgeUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/BuildOldAgeUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.support.HTMLNode;
@@ -37,7 +36,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("div", getText());
}
Modified:
trunk/freenet/src/freenet/node/useralerts/ClockProblemDetectedUserAlert.java
===================================================================
---
trunk/freenet/src/freenet/node/useralerts/ClockProblemDetectedUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++
trunk/freenet/src/freenet/node/useralerts/ClockProblemDetectedUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.support.HTMLNode;
@@ -44,7 +43,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("div", getText());
}
Modified: trunk/freenet/src/freenet/node/useralerts/ExtOldAgeUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/ExtOldAgeUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/ExtOldAgeUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -1,7 +1,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.support.HTMLNode;
@@ -29,7 +28,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("div", getText());
}
Modified: trunk/freenet/src/freenet/node/useralerts/IPUndetectedUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/IPUndetectedUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/IPUndetectedUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.config.Option;
import freenet.config.SubConfig;
import freenet.l10n.L10n;
@@ -48,7 +47,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
if(node.ipDetector.noDetectPlugins()) {
HTMLNode p = new HTMLNode("p");
L10n.addL10nSubstitution(p,
"IPUndetectedUserAlert.loadDetectPlugins", new String[] { "plugins",
"/plugins", "config", "/config" }, new String[] { "<a
href=\""+fixer.fixLink("/plugins/")+"\">", "</a>", "<a
href=\""+fixer.fixLink("/config/")+"\">", "</a>" });
@@ -62,7 +61,8 @@
new String[] { "link", "/link" },
new String[] { "<a
href=\""+fixer.fixLink("/config/")+"\">", "</a>" });
addPortForwardSuggestion(textNode);
- HTMLNode formNode = fixer.addFormChild(textNode, "/config/",
"setTempAddressAlertForm");
+ HTMLNode formNode = textNode.addChild("form", new String[] {
"action", "method" }, new String[] { "/config/", "post" });
+ formNode.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "hidden", "formPassword",
node.clientCore.formPassword });
HTMLNode listNode = formNode.addChild("ul", "class", "config");
HTMLNode itemNode = listNode.addChild("li");
itemNode.addChild("span", "class", "configshortdesc",
L10n.getString(o.getShortDesc())).addChild("input", new String[] { "type",
"name", "value" }, new String[] { "text", sc.getPrefix() +
".tempIPAddressHint", o.getValueString() });
Modified:
trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java
===================================================================
---
trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++
trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.config.Option;
import freenet.config.SubConfig;
import freenet.l10n.L10n;
@@ -35,7 +34,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
SubConfig sc = node.config.get("node");
Option<?> o = sc.getOption("ipAddressOverride");
@@ -43,7 +42,8 @@
L10n.addL10nSubstitution(textNode,
"InvalidAddressOverrideUserAlert.unknownAddressWithConfigLink",
new String[] { "link", "/link" },
new String[] { "<a href=\"/config/\">", "</a>"
});
- HTMLNode formNode = fixer.addFormChild(textNode, "/config/",
"setAddressInvalidForm");
+ HTMLNode formNode = textNode.addChild("form", new String[] {
"action", "method" }, new String[] { "/config/", "post" });
+ formNode.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "hidden", "formPassword",
node.clientCore.formPassword });
HTMLNode listNode = formNode.addChild("ul", "class", "config");
HTMLNode itemNode = listNode.addChild("li");
itemNode.addChild("span", "class", "configshortdesc",
L10n.getString(o.getShortDesc())).addChild("input", new String[] { "type",
"name", "value" }, new String[] { "text", sc.getPrefix() +
".ipAddressOverride", o.getValueString() });
Modified:
trunk/freenet/src/freenet/node/useralerts/MeaningfulNodeNameUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/MeaningfulNodeNameUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/MeaningfulNodeNameUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.config.Option;
import freenet.config.SubConfig;
import freenet.l10n.L10n;
@@ -39,14 +38,15 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
SubConfig sc = node.config.get("node");
Option<?> o = sc.getOption("name");
HTMLNode alertNode = new HTMLNode("div");
HTMLNode textNode = alertNode.addChild("div");
textNode.addChild("#", l10n("noNodeNick"));
- HTMLNode formNode = fixer.addFormChild(alertNode, "/config/",
"setNameAlertForm");
+ HTMLNode formNode = alertNode.addChild("form", new String[] {
"action", "method" }, new String[] { "/config/", "post" });
+ formNode.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "hidden", "formPassword",
node.clientCore.formPassword });
HTMLNode listNode = formNode.addChild("ul", "class", "config");
HTMLNode itemNode = listNode.addChild("li");
itemNode.addChild("span", new String[]{ "class", "title",
"style" },
Modified: trunk/freenet/src/freenet/node/useralerts/N2NTMUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/N2NTMUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/N2NTMUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -7,7 +7,6 @@
import java.util.Date;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.node.DarknetPeerNode;
import freenet.support.HTMLNode;
@@ -54,7 +53,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode alertNode = new HTMLNode("div");
alertNode.addChild("p",
l10n("header", new String[] { "from",
"composed", "sent", "received" },
Modified:
trunk/freenet/src/freenet/node/useralerts/NotEnoughNiceLevelsUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/NotEnoughNiceLevelsUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/NotEnoughNiceLevelsUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -5,7 +5,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.support.HTMLNode;
import freenet.support.io.NativeThread;
@@ -42,7 +41,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("div", getText());
}
Modified: trunk/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.node.NodeStats;
import freenet.support.HTMLNode;
@@ -176,7 +175,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
HTMLNode alertNode = new HTMLNode("div");
if (peers == 0 && !isOpennetEnabled) {
Modified: trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -1,7 +1,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.support.HTMLNode;
/**
@@ -46,7 +45,7 @@
return alert.getText();
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return alert.getHTMLText(fixer);
}
Modified:
trunk/freenet/src/freenet/node/useralerts/TimeSkewDetectedUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/TimeSkewDetectedUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/TimeSkewDetectedUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.support.HTMLNode;
@@ -45,7 +44,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("div", getText());
}
Modified:
trunk/freenet/src/freenet/node/useralerts/UpdatedVersionAvailableUserAlert.java
===================================================================
---
trunk/freenet/src/freenet/node/useralerts/UpdatedVersionAvailableUserAlert.java
2009-01-21 12:45:23 UTC (rev 25181)
+++
trunk/freenet/src/freenet/node/useralerts/UpdatedVersionAvailableUserAlert.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -4,7 +4,6 @@
package freenet.node.useralerts;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.l10n.L10n;
import freenet.node.updater.NodeUpdateManager;
import freenet.node.updater.RevocationChecker;
@@ -77,7 +76,7 @@
}
@Override
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
UpdateThingy ut = createUpdateThingy();
@@ -86,8 +85,7 @@
alertNode.addChild("#", ut.firstBit);
if(ut.formText != null) {
- fixer.addFormChild(alertNode, "/", "updateNowForm").
- addChild("input", new String[] { "type",
"name", "value" }, new String[] { "submit", "update", ut.formText });
+ alertNode.addChild("form", new String[] { "action",
"method" }, new String[] { "/", "post" }).addChild("input", new String[] {
"type", "name", "value" }, new String[] { "submit", "update", ut.formText });
}
return alertNode;
Modified: trunk/freenet/src/freenet/node/useralerts/UserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/UserAlert.java 2009-01-21
12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/UserAlert.java 2009-01-21
13:45:28 UTC (rev 25182)
@@ -3,7 +3,7 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.node.useralerts;
-import freenet.clients.http.ToadletContainer;
+import freenet.clients.http.LinkFixer;
import freenet.support.HTMLNode;
public interface UserAlert {
@@ -27,7 +27,7 @@
/**
* Content of alert (HTML).
*/
- public HTMLNode getHTMLText(ToadletContainer ctx);
+ public HTMLNode getHTMLText(LinkFixer fixer);
/**
* *Really* concise text of alert. Should be comfortably under a line
even when translated
Modified: trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -9,7 +9,6 @@
import java.util.LinkedHashSet;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.clients.http.ToadletContext;
import freenet.l10n.L10n;
import freenet.node.NodeClientCore;
@@ -104,7 +103,7 @@
/**
* Write the alerts as HTML.
*/
- public HTMLNode createAlerts(ToadletContainer fixer) {
+ public HTMLNode createAlerts(LinkFixer fixer) {
HTMLNode alertsNode = new HTMLNode("div");
UserAlert[] alerts = getAlerts();
int totalNumber = 0;
@@ -126,7 +125,7 @@
* Write each alert in uber-concise form as HTML, with a link to
* /alerts/[ anchor pointing to the real alert].
*/
- public HTMLNode createAlertsShort(String title, boolean advancedMode,
boolean drawDumpEventsForm, ToadletContainer ctx) {
+ public HTMLNode createAlertsShort(String title, boolean advancedMode,
boolean drawDumpEventsForm, ToadletContext ctx) {
UserAlert[] currentAlerts = getAlerts();
short maxLevel = Short.MAX_VALUE;
int events = 0;
@@ -156,7 +155,8 @@
totalNumber++;
}
if(drawDumpEventsForm) {
- HTMLNode dumpFormNode = ctx.addFormChild(contentNode,
"/", "dropAlertsForm");
+ HTMLNode dumpFormNode = contentNode.addChild("form",
new String[] { "action", "method" }, new String[] { "/", "post"
}).addChild("div");
+ dumpFormNode.addChild("input", new String[] { "type",
"name", "value" }, new String[] { "hidden", "formPassword", core.formPassword
});
StringBuilder sb = new StringBuilder();
for(int i=0;i<currentAlerts.length;i++) {
if(!currentAlerts[i].isEventNotification())
continue;
@@ -177,7 +177,7 @@
* The user alert to render
* @return The rendered HTML node
*/
- public HTMLNode renderAlert(UserAlert userAlert, ToadletContainer
fixer) {
+ public HTMLNode renderAlert(UserAlert userAlert, LinkFixer fixer) {
HTMLNode userAlertNode = null;
short level = userAlert.getPriorityClass();
userAlertNode = new HTMLNode("div", "class", "infobox
infobox-"+getAlertLevelName(level));
@@ -186,8 +186,9 @@
HTMLNode alertContentNode = userAlertNode.addChild("div",
"class", "infobox-content");
alertContentNode.addChild(userAlert.getHTMLText(fixer));
if (userAlert.userCanDismiss()) {
- HTMLNode dismissFormNode =
fixer.addFormChild(alertContentNode, "/", "dismissAlert-" + userAlert.anchor());
+ HTMLNode dismissFormNode =
alertContentNode.addChild("form", new String[] { "action", "method" }, new
String[] { "/", "post" }).addChild("div");
dismissFormNode.addChild("input", new String[] {
"type", "name", "value" }, new String[] { "hidden", "disable",
String.valueOf(userAlert.hashCode()) });
+ dismissFormNode.addChild("input", new String[] {
"type", "name", "value" }, new String[] { "hidden", "formPassword",
core.formPassword });
dismissFormNode.addChild("input", new String[] {
"type", "name", "value" }, new String[] { "submit", "dismiss-user-alert",
userAlert.dismissButtonText() });
}
return userAlertNode;
Modified: trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -24,9 +24,9 @@
this.plugin = plug;
this.pluginManager = pm;
if (plugin instanceof FredPluginL10n)
- pageMaker = new PageMaker((FredPluginL10n)plugin,
pluginManager.getFProxyTheme(), node.getLinkFilter());
+ pageMaker = new PageMaker((FredPluginL10n)plugin,
pluginManager.getFProxyTheme());
else
- pageMaker = new PageMaker(null,
pluginManager.getFProxyTheme(), node.getLinkFilter());
+ pageMaker = new PageMaker(null,
pluginManager.getFProxyTheme());
}
//public HighLevelSimpleClient getHLSimpleClient() throws
PluginSecurityException {
Modified: trunk/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
2009-01-21 12:45:23 UTC (rev 25181)
+++ trunk/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
2009-01-21 13:45:28 UTC (rev 25182)
@@ -30,7 +30,6 @@
import org.tanukisoftware.wrapper.WrapperManager;
import freenet.clients.http.LinkFixer;
-import freenet.clients.http.ToadletContainer;
import freenet.keys.KeyVerifyException;
import freenet.l10n.L10n;
import freenet.node.SemiOrderedShutdownHook;
@@ -1419,7 +1418,7 @@
return L10n.getString("UserAlert.hide");
}
- public HTMLNode getHTMLText(ToadletContainer fixer) {
+ public HTMLNode getHTMLText(LinkFixer fixer) {
return new HTMLNode("#", getText());
}
Property changes on: trunk/freenet/test/freenet/support/io/MockInputStream.java
___________________________________________________________________
Deleted: svn:mergeinfo
-