Author: j16sdiz
Date: 2009-02-17 06:27:42 +0000 (Tue, 17 Feb 2009)
New Revision: 25663
Modified:
trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
Log:
fix bug #2650
Modified: trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
2009-02-16 22:51:01 UTC (rev 25662)
+++ trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
2009-02-17 06:27:42 UTC (rev 25663)
@@ -66,15 +66,20 @@
currentPath = new File(path).getCanonicalFile();
- if(!core.allowUploadFrom(currentPath)) {
- sendErrorPage(toadletContext, 403, "Forbidden",
l10n("dirAccessDenied"));
- return;
- }
PageMaker pageMaker = toadletContext.getPageMaker();
HTMLNode pageNode = pageMaker.getPageNode(l10n("listingTitle",
"path", currentPath.getAbsolutePath()), toadletContext);
HTMLNode contentNode = pageMaker.getContentNode(pageNode);
+
+ if(!core.allowUploadFrom(currentPath)) {
+ HTMLNode infoboxE =
contentNode.addChild(pageMaker.getInfobox("infobox-error", "Forbidden"));
+ HTMLNode infoboxEContent =
pageMaker.getContentNode(infoboxE);
+ infoboxEContent.addChild("#", l10n("dirAccessDenied"));
+
+ currentPath = new
File(System.getProperty("user.home")); // FIXME what if user.home is denied as
well?
+ }
+
if(toadletContext.isAllowedFullAccess())
contentNode.addChild(core.alerts.createSummary());
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs