[freenet-cvs] r15614 - in trunk/freenet/src/freenet: clients/http l10n

bombe at freenetproject.org bombe at freenetproject.org
Sat Oct 27 18:18:45 UTC 2007


Author: bombe
Date: 2007-10-27 18:18:45 +0000 (Sat, 27 Oct 2007)
New Revision: 15614

Modified:
   trunk/freenet/src/freenet/clients/http/PproxyToadlet.java
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
Log:
fix issue #1823

Modified: trunk/freenet/src/freenet/clients/http/PproxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PproxyToadlet.java	2007-10-27 17:54:26 UTC (rev 15613)
+++ trunk/freenet/src/freenet/clients/http/PproxyToadlet.java	2007-10-27 18:18:45 UTC (rev 15614)
@@ -58,7 +58,7 @@
 		}
 
 		if(!ctx.isAllowedFullAccess()) {
-			super.sendErrorPage(ctx, 403, "Unauthorized", l10n("unauthorized"));
+			super.sendErrorPage(ctx, 403, l10n("unauthorizedTitle"), l10n("unauthorized"));
 			return;
 		}
 
@@ -131,6 +131,7 @@
 							Logger
 							.error(this,
 							"We don't allow downloads from anywhere else but our server");
+							sendErrorPage(ctx, 403, l10n("Error"), l10n("downloadNotAllowedFromRemoteServer"));
 							return;
 						}
 						String pluginname = filename.substring(0,
@@ -153,8 +154,10 @@
 								Logger
 								.normal(this,
 								"The plugin directory hasn't been found, let's create it");
-								if (!pluginsDirectory.mkdir())
+								if (!pluginsDirectory.mkdir()) {
+									sendErrorPage(ctx, 500, l10n("Error"), l10n("pluginDirectoryNotCreated"));
 									return;
+								}
 							}
 
 							File finalFile = new File("plugins/" + pluginname
@@ -173,14 +176,17 @@
 							Logger.error(this,
 									"MalformedURLException has occured : " + mue,
 									mue);
+							sendErrorPage(ctx, l10n("Error"), l10n("pluginNotDownloaded"), mue);
 							return;
 						} catch (FileNotFoundException e) {
 							Logger.error(this,
 									"FileNotFoundException has occured : " + e, e);
+							sendErrorPage(ctx, l10n("Error"), l10n("pluginNotDownloaded"), e);
 							return;
 						} catch (IOException ioe) {
 							System.out.println("Caught :" + ioe.getMessage());
 							ioe.printStackTrace();
+							sendErrorPage(ctx, l10n("Error"), l10n("pluginNotDownloaded"), ioe);
 							return;
 						} finally {
 							try {
@@ -190,10 +196,13 @@
 							}
 						}
 					}
-					if (filename == null)
+					if (filename == null) {
+						sendErrorPage(ctx, 500, l10n("Error"), l10n("pluginNotDownloaded"));
 						return;
+					}
 					else if(!downloaded) {
 						Logger.error(this, "Can't load the given plugin; giving up");
+						sendErrorPage(ctx, 500, l10n("Error"), l10n("pluginNotDownloaded"));
 						return;
 					}
 				}

Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties	2007-10-27 17:54:26 UTC (rev 15613)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties	2007-10-27 18:18:45 UTC (rev 15614)
@@ -672,6 +672,8 @@
 PluginToadlet.unsupportedMethodTitle=Unsupported Method
 PluginToadlet.visit=Visit
 PproxyToadlet.classNameTitle=Class Name
+PproxyToadlet.downloadNotAllowedFromRemoteServer=Download of plugins is only allowed from our server.
+PproxyToadlet.Error=Error
 PproxyToadlet.internalIDTitle=Internal ID
 PproxyToadlet.loadPluginLabel=Load Plugin:
 PproxyToadlet.noPlugins=No plugins loaded
@@ -684,7 +686,11 @@
 PproxyToadlet.reload=Reload
 PproxyToadlet.returnToPluginPage=Return to plugin page
 PproxyToadlet.startedAtTitle=Started at
+PproxyToadlet.pluginDirectoryNotCreated=The plugin directory could not be created.
+PproxyToadlet.pluginNotDownloaded=The plugin could not be downloaded.
 PproxyToadlet.pluginStopping=Plugin Stopping
+PproxyToadlet.unauthorizedTitle=Unauthorized Access
+PproxyToadlet.unauthorized=You are not authorized to view this page.
 PproxyToadlet.unload=Unload
 PproxyToadlet.unloadPluginTitle=Unload plugin?
 PproxyToadlet.unloadPluginWithName=Are you sure you wish to unload ${name}?




More information about the cvs mailing list