I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 9d1ae891 authored by zzz's avatar zzz
Browse files

check for mismatched versions

parent 2df7247e
No related branches found
No related tags found
No related merge requests found
...@@ -209,6 +209,8 @@ public class PluginUpdateHandler extends UpdateHandler { ...@@ -209,6 +209,8 @@ public class PluginUpdateHandler extends UpdateHandler {
return; return;
} }
} }
String sudVersion = TrustedUpdate.getVersionString(f);
f.delete(); f.delete();
String appName = props.getProperty("name"); String appName = props.getProperty("name");
...@@ -219,6 +221,11 @@ public class PluginUpdateHandler extends UpdateHandler { ...@@ -219,6 +221,11 @@ public class PluginUpdateHandler extends UpdateHandler {
updateStatus("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>"); updateStatus("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>");
return; return;
} }
if (!version.equals(sudVersion)) {
to.delete();
updateStatus("<b>" + _("Plugin {0} has mismatched versions", appName) + "</b>");
return;
}
// todo compare sud version with property version // todo compare sud version with property version
...@@ -242,7 +249,7 @@ public class PluginUpdateHandler extends UpdateHandler { ...@@ -242,7 +249,7 @@ public class PluginUpdateHandler extends UpdateHandler {
if (destDir.exists()) { if (destDir.exists()) {
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) { if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
to.delete(); to.delete();
updateStatus("<b>" + _("Downloaded plugin is not for upgrading but the plugin is already installed", url) + "</b>"); updateStatus("<b>" + _("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "</b>");
return; return;
} }
......
...@@ -55,7 +55,7 @@ button span.hide{ ...@@ -55,7 +55,7 @@ button span.hide{
</p><hr><div class="formaction"> </p><hr><div class="formaction">
<input type="submit" name="action" value="<%=intl._("Save WebApp Configuration")%>" /> <input type="submit" name="action" value="<%=intl._("Save WebApp Configuration")%>" />
</div></div><h3><a name="webapp"></a><%=intl._("Plugin Configuration")%></h3><p> </div></div><h3><a name="webapp"></a><%=intl._("Plugin Configuration")%></h3><p>
<%=intl._("The plugins listed below are started by the webConsole client and run in the same JVM as the router. They are usually web applications accessible through the router console.")%> <%=intl._("The plugins listed below are started by the webConsole client.")%>
</p><div class="wideload"><p> </p><div class="wideload"><p>
<jsp:getProperty name="clientshelper" property="form3" /> <jsp:getProperty name="clientshelper" property="form3" />
</p><hr><div class="formaction"> </p><hr><div class="formaction">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment