Fixed 'Restart Lesson' bug in SoapRequest.java. Successful completion of a lesson resets the function invocation counters. Added HttpOnly lesson with improved browser identification support.

git-svn-id: http://webgoat.googlecode.com/svn/trunk@25 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
esheri3 2006-10-09 14:28:09 +00:00
parent 6916632841
commit b6256a17f1
2 changed files with 16 additions and 4 deletions

View File

@ -280,8 +280,7 @@ public class HttpOnly extends LessonAdapter {
readSuccess = false;
writeSuccess = false;
}
}
else {
} else {
if (!this.isCompleted(s)) {
s.setMessage("Now try to see if your browser protects write access to this cookie.");
readSuccess = true;
@ -313,8 +312,7 @@ public class HttpOnly extends LessonAdapter {
readSuccess = false;
writeSuccess = false;
}
}
else {
} else {
if (!this.isCompleted(s)) {
s.setMessage("Now try to see if your browser protects read access to this cookie.");
writeSuccess = true;
@ -370,6 +368,18 @@ public class HttpOnly extends LessonAdapter {
result = "Internet Explorer";
} else if(browser.indexOf("opera") != -1) {
result = "Opera";
} else if(browser.indexOf("safari") != -1) {
result = "Safari";
} else if(browser.indexOf("netscape") != -1) {
browser = browser.substring(browser.indexOf("netscape"));
offset = getOffset(browser);
result = browser.substring(0, offset);
} else if(browser.indexOf("konqueror") != -1) {
result = "Konqueror";
} else if(browser.indexOf("mozilla") != -1) {
result = "Mozilla";
}
}

View File

@ -299,6 +299,8 @@ public class SoapRequest extends LessonAdapter {
// before completing the lesson.
if ((accessFirstName + accessLastName + accessCreditCard + accessLoginCount) >= 2)
{
/** Reset function access counters **/
accessFirstName = accessLastName = accessCreditCard = accessLoginCount = 0;
//SoapRequest.completed = true;
makeSuccess(s);
}