From d0acfc00c00deddf8bf5ec24b97bd87cfbf785da Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 9 Apr 2016 22:08:40 +0200 Subject: [PATCH] Menu options about version, user info work again. --- webgoat-container/pom.xml | 27 ++++++++++++++++-- .../owasp/webgoat/plugins/PluginsLoader.java | 10 ++----- .../src/main/resources/application.properties | 4 +++ .../js/goatApp/view/DeveloperControlsView.js | 2 +- .../main/resources/static/js/makeWindow.js | 7 ----- .../main/resources/templates/main_new.html | 28 ++++++++++++------- 6 files changed, 51 insertions(+), 27 deletions(-) delete mode 100644 webgoat-container/src/main/resources/static/js/makeWindow.js diff --git a/webgoat-container/pom.xml b/webgoat-container/pom.xml index c3d211fce..908811556 100644 --- a/webgoat-container/pom.xml +++ b/webgoat-container/pom.xml @@ -98,13 +98,31 @@ - ${basedir}/src/main/java + src/main/java - ${basedir}/src/main/resources + src/main/resources + true + + **/application.properties + + + + src/main/resources + + org.apache.maven.plugins + maven-resources-plugin + 2.6 + + + @ + + false + + org.apache.maven.plugins maven-compiler-plugin @@ -253,6 +271,11 @@ org.springframework.boot spring-boot-starter-thymeleaf + + org.thymeleaf.extras + thymeleaf-extras-springsecurity4 + 2.1.2.RELEASE + org.xeustechnologies jcl-core diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/plugins/PluginsLoader.java b/webgoat-container/src/main/java/org/owasp/webgoat/plugins/PluginsLoader.java index 2e23f8ce3..ba5df6475 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/plugins/PluginsLoader.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/plugins/PluginsLoader.java @@ -139,13 +139,9 @@ public class PluginsLoader { for (final URL jar : jars) { classLoader.addURL(jar); - extractorCallables.add(new Callable() { - - @Override - public Plugin call() throws Exception { - PluginExtractor extractor = new PluginExtractor(); - return extractor.extractJarFile(ResourceUtils.getFile(jar), pluginTarget.toFile(), classLoader); - } + extractorCallables.add(() -> { + PluginExtractor extractor = new PluginExtractor(); + return extractor.extractJarFile(ResourceUtils.getFile(jar), pluginTarget.toFile(), classLoader); }); } return extractorCallables; diff --git a/webgoat-container/src/main/resources/application.properties b/webgoat-container/src/main/resources/application.properties index ab0938190..f794d79cc 100644 --- a/webgoat-container/src/main/resources/application.properties +++ b/webgoat-container/src/main/resources/application.properties @@ -10,7 +10,11 @@ logging.level.org.hibernate=ERROR spring.thymeleaf.cache=false security.enable-csrf=false +server.contextPath=/WebGoat +server.port=8080 + webgoat.build.version=@project.version@ +webgoat.build.number=@build.number@ webgoat.email=webgoat@owasp.org webgoat.emaillist=owasp-webgoat@lists.owasp.org webgoat.feedback.address=webgoat@owasp.org diff --git a/webgoat-container/src/main/resources/static/js/goatApp/view/DeveloperControlsView.js b/webgoat-container/src/main/resources/static/js/goatApp/view/DeveloperControlsView.js index ffd66bc9d..42d383f52 100644 --- a/webgoat-container/src/main/resources/static/js/goatApp/view/DeveloperControlsView.js +++ b/webgoat-container/src/main/resources/static/js/goatApp/view/DeveloperControlsView.js @@ -11,7 +11,7 @@ function( LabelDebugModel) { return Backbone.View.extend({ el: '#developer-controls', - + onControlClick: function(model) { $('#' + model.id).find('td').text('Loading...'); model.load(); diff --git a/webgoat-container/src/main/resources/static/js/makeWindow.js b/webgoat-container/src/main/resources/static/js/makeWindow.js deleted file mode 100644 index 58e76dfdb..000000000 --- a/webgoat-container/src/main/resources/static/js/makeWindow.js +++ /dev/null @@ -1,7 +0,0 @@ - -function makeWindow(url, windowName) -{ - day = new Date(); - id = day.getTime(); - eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,location=0,scrollbars=1,statusbar=0,menubar=0,resizable=1,width=600,height=500');"); -} \ No newline at end of file diff --git a/webgoat-container/src/main/resources/templates/main_new.html b/webgoat-container/src/main/resources/templates/main_new.html index b8cd94238..ea5b6eadf 100644 --- a/webgoat-container/src/main/resources/templates/main_new.html +++ b/webgoat-container/src/main/resources/templates/main_new.html @@ -1,5 +1,6 @@ - + @@ -61,17 +62,22 @@ @@ -152,12 +158,14 @@

Params

-
-

Developer controls

-
-
-
+
+
+

Developer controls

+
+
+
+