From b706cce5d6b09e01a9c9df7aae0c8122c0e48bac Mon Sep 17 00:00:00 2001 From: awnuk Date: Mon, 19 Sep 2011 22:38:12 +0000 Subject: Fixed bugzilla bug #737423, which is part of fix for bugzilla bug #598728. git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@2215 c9f7a03b-bd48-0410-a16d-cbbf54688b0b --- .../shared/webapps/ca/agent/ca/processReq.template | 51 ++++++++++++++++------ 1 file changed, 38 insertions(+), 13 deletions(-) (limited to 'pki') diff --git a/pki/dogtag/ca-ui/shared/webapps/ca/agent/ca/processReq.template b/pki/dogtag/ca-ui/shared/webapps/ca/agent/ca/processReq.template index 1e342df08..5bc143bac 100644 --- a/pki/dogtag/ca-ui/shared/webapps/ca/agent/ca/processReq.template +++ b/pki/dogtag/ca-ui/shared/webapps/ca/agent/ca/processReq.template @@ -244,7 +244,7 @@ function renderPublicKeyInfo() ''+ 'Public key:'); document.writeln(''+ - result.header.subjectPublicKey + ''); + result.header.subjectPublicKey.replace(/\n/g, "
") + ''); //if (result.header.status == 'pending') { //document.writeln(''); @@ -957,47 +957,72 @@ function renderPolicyInfo() } } +function renderLongStrings(value) +{ + var len = value.toString().length; + if (len > 64 && value.toString().indexOf("\n") > 0) { + document.writeln(value.toString().replace(/\n/g, "
")); + } else if (len > 64) { + for (var i = 0; i < len; i += 64) { + var n = len; + var b = ""; + if (i+64 < len) { + n = i + 64; + b = "
"; + } + document.writeln(value.toString().substring(i, n)+b); + } + } else { + document.writeln(value); + } +} + +function renderNameAndValue(name, value) +{ + document.writeln(''); + document.writeln(''); + document.writeln(name); + document.writeln(''); + document.writeln(''); + document.writeln(''); + renderLongStrings(value); + document.writeln(''); +} + function renderRequestAttrs() { document.writeln(''); document.writeln(''); document.writeln('Unauthenticated Request Attributes'); - document.writeln(''); - document.writeln('
');
 	if (result.header.HTTP_PARAMS.length > 0) {
-		document.writeln("");
 		for (var i = 0; i < result.header.HTTP_PARAMS.length; i++) {
-			document.writeln("HTTP_PARAMS."+result.header.HTTP_PARAMS[i].name+"="+result.header.HTTP_PARAMS[i].value);
+			renderNameAndValue("HTTP_PARAMS."+result.header.HTTP_PARAMS[i].name+":", result.header.HTTP_PARAMS[i].value);
 		}
 	}
 	if (result.header.HTTP_HEADERS.length > 0) {
 		document.writeln("");
 		for (var j = 0; j < result.header.HTTP_HEADERS.length; j++) {
-			document.writeln("HTTP_HEADERS."+result.header.HTTP_HEADERS[j].name+"="+result.header.HTTP_HEADERS[j].value);
+			renderNameAndValue("HTTP_HEADERS."+result.header.HTTP_HEADERS[j].name+":", result.header.HTTP_HEADERS[j].value);
 		}
 	}
-	document.writeln('
'); document.writeln(''); document.writeln(''); document.writeln('Authenticate Request Attributes (from authentication, policy and other server modules)'); - document.writeln(''); - document.writeln('
');
 	if (result.header.AUTH_TOKEN.length > 0) {
 		document.writeln("");
 		for (var k = 0; k < result.header.AUTH_TOKEN.length; k++) {
-			document.writeln("AUTH_TOKEN."+result.header.AUTH_TOKEN[k].name+"="+result.header.AUTH_TOKEN[k].value);
+			renderNameAndValue("AUTH_TOKEN."+result.header.AUTH_TOKEN[k].name+":", result.header.AUTH_TOKEN[k].value);
 		}
 	}
 	if (result.header.SERVER_ATTRS.length > 0) {
 		document.writeln("");
 		for (var l = 0; l < result.header.SERVER_ATTRS.length; l++) {
 			//if (result.header.SERVER_ATTRS[l].name != 'CERT_INFO')
-				document.writeln(result.header.SERVER_ATTRS[l].name+"="+result.header.SERVER_ATTRS[l].value);
+			renderNameAndValue(result.header.SERVER_ATTRS[l].name+":", result.header.SERVER_ATTRS[l].value);
 		}
 	}
-	document.writeln('
'); } @@ -1370,7 +1395,7 @@ renderPolicyInfo(); document.writeln('
 '); -renderFoot(); +//renderFoot(); document.writeln(''); -- cgit