Debug.jsp revision 76ad7ecb4e4f3ca5bc014a996cebf0942b7c09c9
1777N/A String category = request.getParameter("category");
1777N/A String instance = request.getParameter("instance");
1777N/A String level = request.getParameter("level");
1777N/A if (!ESAPI.validator().isValidInput("category", category, "HTTPParameterValue", 512, true)
1707N/A || !ESAPI.validator().isValidInput("instance", instance, "HTTPParameterValue", 512, true)
|| !ESAPI.validator().isValidInput("level", level, "HTTPParameterValue", 512, true)) {
ResourceBundle rbFiles = ResourceBundle.getBundle("debugfiles");
SSOTokenManager sMgr = SSOTokenManager.getInstance();
SSOToken ssoToken = sMgr.createSSOToken(request);
String adminUser = SystemProperties.get(
adminUserDN = DNUtils.normalizeDN(adminUser);
IdType.USER, "/", null);
// This will be your incoming user/token.
ssoToken.getPrincipal().getName()))) &&
(!user.equals(adminUserId))) {
List<Debug> temp = new ArrayList<Debug>(Debug.getInstances());
Collections.sort(instances);
for (Enumeration e = rbFiles.getKeys();
String key = (String)e.nextElement();
String val = rbFiles.getString(key);
List lst = (List) categories.get(val);
lst.add(key);
categories.put(val, lst);
String receivedToken = request.getParameter("formToken");
if (!formToken.equals(receivedToken)) {
out.println("Invalid form token provided!");
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<div class="SkpMedGry1"><a href="#SkipAnchor3860"><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1" /></a></div><div class="MstDiv">
<div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="com_sun_web_ui/images/PrimaryProductName.png" alt="OpenAM" border="0" /></div>
<table class="SkpMedGry1" border="0" cellpadding="5" cellspacing="0" width="100%"><tr><td><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1" /></a></td></tr></table>
|| level == null || level.length() == 0
<form name="frm" action="Debug.jsp" method="POST">
String key = (String)i.next();
out.println("<option>" + key + "</option>");
out.println("<option value=\"1\">" +
resourceBundle.getString("label-level-error") + "</option>");
out.println("<option value=\"2\">" +
resourceBundle.getString("label-level-warning") + "</option>");
out.println("<option value=\"3\">" +
resourceBundle.getString("label-level-message") + "</option>");
<td><input type="submit" value="Submit" class="Btn1" onclick="this.form.submit();" onmouseover="javascript: this.className='Btn1Hov'" onmouseout="javascript: this.className='Btn1'" onblur="javascript: javascript: this.className='Btn1'" onfocus="javascript: this.className='Btn1Hov'" />
<form name="frm" action="Debug.jsp" method="POST">
out.println("<option>" + inst + "</option>");
out.println("<option value=\"1\">" +
resourceBundle.getString("label-level-error") + "</option>");
out.println("<option value=\"2\">" +
resourceBundle.getString("label-level-warning") + "</option>");
out.println("<option value=\"3\">" +
resourceBundle.getString("label-level-message") + "</option>");
<td><input type="submit" value="Submit" class="Btn1" onclick="this.form.submit();" onmouseover="javascript: this.className='Btn1Hov'" onmouseout="javascript: this.className='Btn1'" onblur="javascript: javascript: this.className='Btn1'" onfocus="javascript: this.className='Btn1Hov'" />
String key = (String)i.next();
out.println("<tr><td valign=top><b>" + key + "</b></td>");
List values = (List)categories.get(key);
out.println("<td>");
msg = resourceBundle.getString("message-category-"+key);
out.println("<b>"+msg+"</b><br>");
out.print("<span class=\"HlpFldTxt\">");
out.print("</span>");
out.println("</td></tr>");
out.println("Instance" + " = " + instance);
out.println("<br />");
if (level.equals("1")) {
} else if (level.equals("2")) {
out.println("<br />");
int levelint = Integer.parseInt(level);
resourceBundle.getString("message-setting-level-on-modules"), param));
out.println("<br />");
List values = (List)categories.get(category);
out.println("<ul>");
String mname = (String)i.next();
out.println( "<li>" + mname + "</li>" );
Debug debug = Debug.getInstance(mname);
debug.setDebug(levelint);
out.println("</ul>");
resourceBundle.getString("message-setting-level-on-instance"), param));
Debug.getInstance(instance).setDebug(levelint);
String backURL = "Debug.jsp";
out.println("<input name='category' type='hidden' value='" + category + "' />");
out.println("<input name='instance' type='hidden' value='" + instance + "' />");
out.println("<input name='level' type='hidden' value='" + levelint + "' />");
out.println("<input name='do' type='hidden' value='true' />");
out.println("<input type='hidden' name='formToken' value='" + formToken + "' />");
out.println("<table border=0>");
out.println("<tr><td>");
out.println("<input type=\"button\" name=\"do\" value=\"" + resourceBundle.getString("button-confirm") + "\" class=\"Btn1\" onclick=\"this.form.submit();\" onmouseover=\"javascript: this.className='Btn1Hov'\" onmouseout=\"javascript: this.className='Btn1'\" onblur=\"javascript: javascript: this.className='Btn1'\" onfocus=\"javascript: this.className='Btn1Hov'\" /></form>");
out.println("</td><td>");
out.println("<input type=\"button\" name=\"back\" value=\"" + resourceBundle.getString("button-back") + "\" class=\"Btn1\" onclick=\"var elements=this.form.elements;for (var i=0;i<elements.length;i++){if(elements[i].type && elements[i].type==='hidden'){elements[i].value=''}};this.form.submit();\" onmouseover=\"javascript: this.className='Btn1Hov'\" onmouseout=\"javascript: this.className='Btn1'\" onblur=\"javascript: this.className='Btn1'\" onfocus=\"javascript: this.className='Btn1Hov'\" />");
out.println("</td></tr></table>");
out.println("</form>");
out.println("<p>");
resourceBundle.getString("message-succeed"), params));