Extract the stage-related code from LessonTracker into SequentialLessonTracker

git-svn-id: http://webgoat.googlecode.com/svn/trunk@157 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes
2007-07-11 12:50:32 +00:00
parent 02560a2510
commit f5e56c7081
18 changed files with 234 additions and 175 deletions

View File

@ -6,6 +6,7 @@ STAGE 4 FIXES Look for the <-- STAGE 4 - FIX
<%
WebSession webSession = ((WebSession)session.getAttribute("websession"));
Employee employee = (Employee) session.getAttribute("CrossSiteScripting." + CrossSiteScripting.EMPLOYEE_ATTRIBUTE_KEY);
CrossSiteScripting lesson = (CrossSiteScripting) webSession.getCurrentLesson();
// int myUserId = getIntSessionAttribute(webSession, "CrossSiteScripting." + CrossSiteScripting.USER_ID);
%>
<div class="lesson_title_box"><strong>Welcome Back </strong><span class="lesson_text_db"><%=webSession.getUserNameInLesson()%></span></div>
@ -83,7 +84,7 @@ WebSession webSession = ((WebSession)session.getAttribute("websession"));
<TD>
<!-- Encode data that might contain HTML content to protect against XSS -->
<%=webSession.htmlEncode(employee.getPersonalDescription())%>
<%=lesson.htmlEncode(webSession, employee.getPersonalDescription())%>
</TD>
<TD>
Manager:
@ -112,7 +113,7 @@ WebSession webSession = ((WebSession)session.getAttribute("websession"));
<tr>
<td width="50">
<%
if (webSession.isAuthorizedInLesson(webSession.getUserIdInLesson(), CrossSiteScripting.EDITPROFILE_ACTION))
if (webSession.isAuthorizedInLesson(webSession.getUserIdInLesson(), CrossSiteScripting.LISTSTAFF_ACTION))
{
%>
<form method="POST" action="attack?menu=<%=webSession.getCurrentMenu()%>">
@ -161,9 +162,9 @@ WebSession webSession = ((WebSession)session.getAttribute("websession"));
<%
if (webSession.getCurrentLesson().getStage(webSession) == 1005)
if (lesson.getStage(webSession) == 1005)
{
webSession.getCurrentLesson().setStage(webSession, 5);
lesson.setStage(webSession, 5);
//System.out.println("Reloading ViewProfile.jsp for stage 5 transition");
String thisPage = webSession.getCurrentLink();
//System.out.println("Redirecting to " + thisPage);