Author: nextgens
Date: 2007-03-24 18:20:45 +0000 (Sat, 24 Mar 2007)
New Revision: 12320

Modified:
   trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
Log:
Don't allow downloads to the download directory if we are in limited mode

Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   2007-03-24 
18:18:42 UTC (rev 12319)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   2007-03-24 
18:20:45 UTC (rev 12320)
@@ -394,15 +394,17 @@
                                HTMLNode optionForm = option.addChild("form", 
new String[] { "action", "method" }, new String[] {'/' + key.toString(), "get" 
});
                                optionForm.addChild("input", new String[] { 
"type", "name", "value" }, new String[] { "hidden", "max-size", 
String.valueOf(e.expectedSize == -1 ? Long.MAX_VALUE : e.expectedSize*2) });
                                optionForm.addChild("input", new String[] { 
"type", "name", "value" }, new String[] { "submit", "fetch", "Fetch anyway and 
display file in browser" });
-                               option = optionList.addChild("li");
-                               optionForm = ctx.addFormChild(option, 
"/queue/", "tooBigQueueForm");
-                               optionForm.addChild("input", new String[] { 
"type", "name", "value" }, new String[] { "hidden", "key", key.toString() });
-                               optionForm.addChild("input", new String[] { 
"type", "name", "value" }, new String[] { "hidden", "return-type", "disk" });
-                               optionForm.addChild("input", new String[] { 
"type", "name", "value" }, new String[] { "hidden", "persistence", "forever" });
-                               if (mime != null) {
-                                       optionForm.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "hidden", "type", mime });
+                               if(ctx.isAllowedFullAccess()) {
+                                       option = optionList.addChild("li");
+                                       optionForm = ctx.addFormChild(option, 
"/queue/", "tooBigQueueForm");
+                                       optionForm.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "hidden", "key", 
key.toString() });
+                                       optionForm.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "hidden", "return-type", 
"disk" });
+                                       optionForm.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "hidden", "persistence", 
"forever" });
+                                       if (mime != null) {
+                                               optionForm.addChild("input", 
new String[] { "type", "name", "value" }, new String[] { "hidden", "type", mime 
});
+                                       }
+                                       optionForm.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "submit", "download", 
"Download in background and store in downloads directory" });
                                }
-                               optionForm.addChild("input", new String[] { 
"type", "name", "value" }, new String[] { "submit", "download", "Download in 
background and store in downloads directory" });
                                optionList.addChild("li").addChild("a", new 
String[] { "href", "title" }, new String[] { "/", "FProxy home page" }, "Abort 
and return to the FProxy home page");

                                writeReply(ctx, 200, "text/html", "OK", 
pageNode.generate());
@@ -453,7 +455,7 @@
                                infoboxContent = infobox.addChild("div", 
"class", "infobox-content");

                                HTMLNode optionList = 
infoboxContent.addChild("ul");
-                               if(!e.isFatal()) {
+                               if(!e.isFatal() && ctx.isAllowedFullAccess()) {
                                        option = optionList.addChild("li");
                                        HTMLNode optionForm = 
ctx.addFormChild(option, "/queue/", "dnfQueueForm");
                                        optionForm.addChild("input", new 
String[] { "type", "name", "value" }, new String[] { "hidden", "key", 
key.toString() });


Reply via email to