Added bug report

Added message for missing solutions
Minor edits to lesson plans

git-svn-id: http://webgoat.googlecode.com/svn/trunk/webgoat@353 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
mayhew64
2008-07-11 00:05:05 +00:00
parent 536d29e78a
commit 084c43381b
9 changed files with 61 additions and 19 deletions

View File

@ -152,7 +152,7 @@ public class LessonSource extends HammerHead
}
}
if (source == null) { return "Source code is not available. Contact "
+ s.getWebgoatContext().getFeedbackAddress(); }
+ s.getWebgoatContext().getFeedbackAddressHTML(); }
return (source.replaceAll("(?s)" + START_SOURCE_SKIP + ".*" + END_SOURCE_SKIP,
"Code Section Deliberately Omitted"));
}
@ -175,7 +175,7 @@ public class LessonSource extends HammerHead
}
}
if (source == null) { return "Solution is not available. Contact "
+ s.getWebgoatContext().getFeedbackAddress(); }
+ s.getWebgoatContext().getFeedbackAddressHTML(); }
return (source);
}

View File

@ -500,10 +500,13 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
// that performs the convertMetacharsJavaCode() transform plus
// optionally adds a styled
// line number. Wouldn't color syntax be great too?
} catch (IOException e)
} catch (Exception e)
{
s.setMessage("Could not find source file");
src = ("Could not find source file");
src = ("Could not find the source file or source file does not exist.<br/>"
+ "Send this message to: <a href=\"mailto:" + s.getWebgoatContext().getFeedbackAddress() + "?subject=Source "
+ getSourceFileName() + " not found. Lesson: " + s.getCurrentLesson().getLessonName() + "\">" +
s.getWebgoatContext().getFeedbackAddress() + "</a>");
}
Html html = new Html();
@ -530,10 +533,13 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
{
System.out.println("Solution: " + getLessonSolutionFileName());
src = readFromFile(new BufferedReader(new FileReader(s.getWebResource(getLessonSolutionFileName()))), false);
} catch (IOException e)
} catch (Exception e)
{
s.setMessage("Could not find the solution file");
src = ("Could not find the solution file");
src = ("Could not find the solution file or solution file does not exist.<br/>"
+ "Send this message to: <a href=\"mailto:" + s.getWebgoatContext().getFeedbackAddress() + "?subject=Solution "
+ getLessonSolutionFileName() + " not found. Lesson: " + s.getCurrentLesson().getLessonName() + "\">" +
s.getWebgoatContext().getFeedbackAddress() + "</a>");
}
Html html = new Html();

View File

@ -73,7 +73,7 @@ public abstract class LessonAdapter extends AbstractLesson
+ "In fact, most lessons can be created by following the easy to use instructions in the "
+ "<A HREF=http://www.owasp.org/index.php/WebGoat_User_and_Install_Guide_Table_of_Contents>WebGoat User Guide.</A>&nbsp;&nbsp;"
+ "If you would prefer, send your lesson ideas to "
+ getWebgoatContext().getFeedbackAddress()));
+ getWebgoatContext().getFeedbackAddressHTML()));
String fileName = s.getContext().getRealPath("doc/New Lesson Instructions.txt");
if (fileName != null)

View File

@ -101,7 +101,7 @@ public class ReportCardScreen extends LessonAdapter
{
ElementContainer ec = new ElementContainer();
ec.addElement(new StringElement("Comments and suggestions are welcome. "
+ getWebgoatContext().getFeedbackAddress() + "<br><br>"));
+ getWebgoatContext().getFeedbackAddressHTML() + "<br><br>"));
return ec;
}

View File

@ -34,7 +34,9 @@ public class WebgoatContext
public final static String DEFUSEOSCOMMANDS = "DefuseOSCommands";
public final static String FEEDBACK_ADDRESS = "FeedbackAddress";
public final static String FEEDBACK_ADDRESS_HTML = "FeedbackAddressHTML";
public final static String FEEDBACK_ADDRESS = "email";
public final static String DEBUG = "debug";
@ -64,7 +66,9 @@ public class WebgoatContext
private boolean codingExercises = false;
private String feedbackAddress = "<A HREF=mailto:webgoat@owasp.org>webgoat@owasp.org</A>";
private String feedbackAddress = "webgoat@owasp.org";
private String feedbackAddressHTML = "<A HREF=mailto:webgoat@owasp.org>webgoat@owasp.org</A>";
private boolean isDebug = false;
@ -88,6 +92,8 @@ public class WebgoatContext
defuseOSCommands = "true".equals(getParameter(servlet, DEFUSEOSCOMMANDS));
enterprise = "true".equals(getParameter(servlet, ENTERPRISE));
codingExercises = "true".equals(getParameter(servlet, CODING_EXERCISES));
feedbackAddressHTML = getParameter(servlet, FEEDBACK_ADDRESS_HTML) != null ? getParameter(servlet, FEEDBACK_ADDRESS_HTML)
: feedbackAddressHTML;
feedbackAddress = getParameter(servlet, FEEDBACK_ADDRESS) != null ? getParameter(servlet, FEEDBACK_ADDRESS)
: feedbackAddress;
showRequest = "true".equals(getParameter(servlet, SHOWREQUEST));
@ -175,6 +181,11 @@ public class WebgoatContext
return feedbackAddress;
}
public String getFeedbackAddressHTML()
{
return feedbackAddressHTML;
}
public boolean isDebug()
{
return isDebug;