From 3c2e63636c144b00d3254fac17aeef62abaf5d9a Mon Sep 17 00:00:00 2001 From: "rogan.dawes" Date: Tue, 10 Jul 2007 11:54:12 +0000 Subject: [PATCH] Provide a user-accessible mechanism for skipping stages Initially, this is only available when in debug mode i.e. add &debug=true to the URL or set the flag in web.xml git-svn-id: http://webgoat.googlecode.com/svn/trunk@146 4033779f-a91e-0410-96ef-6bf7bf53c507 --- .../org/owasp/webgoat/session/WebSession.java | 7 ++++++- webgoat/main/project/WebContent/main.jsp | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java index 11388d196..07fabc360 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java @@ -905,7 +905,12 @@ public class WebSession eatCookies(); hintNum = -1; } - + else if (myParser.getRawParameter( STAGE, null ) != null) + { + int stage = myParser.getIntParameter(STAGE, getCurrentLesson().getStage(this)); + if (stage > 0 && stage <= getCurrentLesson().getStageCount()) + getCurrentLesson().setStage(this, stage); + } // else update global variables for the current screen else { diff --git a/ webgoat/main/project/WebContent/main.jsp b/ webgoat/main/project/WebContent/main.jsp index 81ccea007..b261471e5 100644 --- a/ webgoat/main/project/WebContent/main.jsp +++ b/ webgoat/main/project/WebContent/main.jsp @@ -196,6 +196,20 @@ StringBuffer buildList = new StringBuffer();
Close this Window + <% + if (webSession.isDebug()&& webSession.getCurrentLesson().getStageCount() > 1) { + %>
+
<% + } + %>
<%=webSession.getInstructions()%>
<%=webSession.getMessage()%>